i'm using comm.MIMOChannel. i have problem varying 4x4,8x8 in [chanOut,pathGains] = step(hChan,encData); this...help me... how to rectify that
1 次查看(过去 30 天)
显示 更早的评论
clc close all clear all % rng default warning off %% input decleration numTx =4; % Number of transmit antennas numRx =4; % Number of receive antennas Rs = 1e6; % Sampling rate (Hz) tau = [0 2e-6]; % Path delays (sec) pdb = [0 -10]; % Average path gains (dB) maxDopp = 30; % Maximum Doppler shift (Hz) numBits = 16; % Number of bits SNR= 25; % Signal-to-noise ratio (dB) block_size = 16; % fixing the block size for cyclic prefix data = randi([0 1],numBits,1); %generating random input data hMod = comm.QPSKModulator(... 'BitInput',true,... 'SymbolMapping','Gray'); hDemod = comm.QPSKDemodulator(... 'SymbolMapping','Gray',... 'BitOutput',true); hOSTBCEnc = comm.OSTBCEncoder(... 'NumTransmitAntennas',numTx); hOSTBCComb = comm.OSTBCCombiner(... 'NumTransmitAntennas',numTx,... 'NumReceiveAntennas',numRx); hChan = comm.MIMOChannel('SampleRate',Rs,... 'PathDelays',tau,... 'AveragePathGains',pdb,... 'MaximumDopplerShift',maxDopp,... 'NumTransmitAntennas',numTx,... 'NumReceiveAntennas',numRx,... 'PathGainsOutputPort',true); hAWGN = comm.AWGNChannel(... 'NoiseMethod','Signal to noise ratio (SNR)',... 'SNR',SNR,... 'SignalPower',1); modData = step(hMod,data);
%Qpsk modulation
cp_len = floor(0.5 * length(modData)); %Length of the cyclic prefix fixing
ofdm_signal=ofdm_transmission(modData,cp_len); %initilization cyclic prefix & ifft
encData = step(hOSTBCEnc,ofdm_signal); %STBC encoder
[chanOut,pathGains] = step(hChan,encData);
[rxSignal] = step(hAWGN,chanOut); %applying in channel
% rxSignal = chanOut;
chEst = squeeze(sum(pathGains,2)); %channel estimation
combinedData = step(hOSTBCComb,rxSignal,chEst); %STBC decoder
recvd_serial_data=ofdm_reciving(combinedData,cp_len); %removing cyclic prefix & ifft
receivedData = step(hDemod,recvd_serial_data); %demodulation
[numErrors,ber] = biterr(data,receivedData);
numErrors
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Link-Level Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!