Clear Filters
Clear Filters

i'm using comm.MIMOChannel. i have problem varying 4x4,8x8 in [chanOut,pathGains] = step(hChan,encData); this...help me... how to rectify that

3 views (last 30 days)
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

Answers (0)

Categories

Find more on Propagation and Channel Models in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!