please describe this loop
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Propagation and Channel Models 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!