please describe this loop
1 view (last 30 days)
Show older comments
for i=1 : length(SNR_V) SNR=SNR_V(i); for k=1 : nIteration % generating random channel coefficients h(1:L,1)=random('Normal',0,1,L,1) + ... j * random('Normal',0,1,L,1); h=h./sum(abs(h)); % normalization
% Tr Data TrDataBit=randint(N,1,M); TrDataMod=qammod(TrDataBit,M); TrDataMod(Ip)=Ep * TrDataMod(Ip); TrDataIfft=ifft(TrDataMod,N); TrDataIfftGi=[TrDataIfft(N- GI + 1 : N);TrDataIfft];
% tx Data TxDataIfftGi=filter(h,1,TrDataIfftGi); % channel effect % adding awgn noise TxDataIfftGiNoise=awgn(TxDataIfftGi, SNR - db(std(TxDataIfftGi))); % normalization to signal power db
TxDataIfft=TxDataIfftGiNoise(GI+1:N+GI); TxDataMod=fft(TxDataIfft,N);
% Channel estimation Spilot=TrDataMod(Ip); % trnasmitted pilots Ypilot=TxDataMod(Ip); % received pilots
G=(Ep * length(Ip))^-1* ctranspose(sqrt(Ep)*diag(Spilot)*ctranspose(F(1:L, Ip)));%ctranspose(F(1:L, Ip))=(F(1:L, Ip))'
hHat=G*Ypilot; % estimated channel coefficient in time domain
TxDataBit=qamdemod(TxDataMod./(fft(hHat,N)),M);
% bit error rate computation [nErr bErr(i,k)]=symerr(TxDataBit(Is),TrDataBit(Is)); end end
0 Comments
Answers (0)
See Also
Categories
Find more on Propagation and Channel Models in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!