查看单个帖子
旧 2019-12-01, 04:22   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
默认 如何在Matlab上合并两个功能?

我需要帮助,(据我所知它应该很简单,但是我不经常使用Matlab。)

我有一个图用于降雨引起的波衰减。而且,我有一张显示误码率(BER)(仅受白噪声影响)的图表。

除了白噪声外,我还希望通过扣除图来提高误码率影响图。

在BER代码中,白鼻子显示为“ awgn”。那么,我如何将衰减图与“通过AWGN通道”的第一个代码相结合?提前致谢!

衰减图 BER图

BER代码:

M = 64; % Modulation order k = log2(M); % Bits per symbol EbNoVec = (5:15)'; % Eb/No values (dB) numSymPerFrame = 100; for n = 1:length(EbNoVec) % Convert Eb/No to SNR snrdB = EbNoVec(n) + 10*log10(k); % Reset the error and bit counters numErrs = 0; numBits = 0; while numErrs < 200 && numBits < 1e7 % Generate binary data and convert to symbols dataIn = randi([0 1],numSymPerFrame,k); dataSym = bi2de(dataIn); % QAM modulate using 'Gray' symbol mapping txSig = qammod(dataSym,M); % Pass through AWGN channel rxSig = awgn(txSig,snrdB,'measured'); % Demodulate the noisy signal rxSym = qamdemod(rxSig,M); % Convert received symbols to bits dataOut = de2bi(rxSym,k); % Calculate the number of bit errors nErrors = biterr(dataIn,dataOut); % Increment the error and bit counters numErrs = numErrs + nErrors; numBits = numBits + numSymPerFrame*k; end % Estimate the BER berEst(n) = numErrs/numBits; end berTheory = berawgn(EbNoVec,'qam',M); semilogy(EbNoVec,berEst,'*') hold on semilogy(EbNoVec,berTheory) grid legend('Estimated BER','Theoretical BER') xlabel('Eb/No (dB)') ylabel('Bit Error Rate') 波衰减代码:

R = 1000.0; freq = [10:1000]*1e9; T = 20.0; lwd = 0.5; F = fogpl(R,freq,T,lwd); P = 101300.0; W = 7.5; G = gaspl(R,freq,T,P,W); RR=[0.75,1.75,2.5,3]; for irr=1:length(RR) R = rainpl(10000,freq,RR(irr)); L=R+F+G; loglog(freq/1e9,L); hold on; grid title('rain attenuation') xlabel('Frequency (GHz)') ylabel('Attenuation (dB)') end

更多&回答...
poster 当前离线   回复时引用此帖