How can I plot empirical BER vs. SNR curves for PSK and QAM?
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello! I have a problem with the berawgn function. I want to plot BER to SNR curves for both PSK and QAM (multiple mapping fators 2, 4, 8, 16) with the help of berawgn. As far as the theoretical curves are concerned everything is ok but when it comes to the empirical ones (simulation) it doesn't work properly. Here is an example for PAM from MATLAB help:
1. Compute theoretical error rate using BERAWGN.
M = 8; EbNo = [0:13];
[ber, ser] = berawgn(EbNo,'pam',M);
% Plot theoretical results.
figure; semilogy(EbNo,ser,'r');
xlabel('E_b/N_0 (dB)'); ylabel('Symbol Error Rate');
grid on; drawnow;
% 2. Compute empirical error rate by simulating. % Set up. n = 10000; % Number of symbols to process k = log2(M); % Number of bits per symbol % Convert from EbNo to SNR. % Note: Because No = 2*noiseVariance^2, we must add 3 dB % to get SNR. For details, see Proakis book listed in % "Selected Bibliography for Performance Evaluation." snr = EbNo+3+10*log10(k); ynoisy=zeros(n,length(snr)); % Preallocate to save time.
% Main steps in the simulation x = randint(n,1,M); % Create message signal. y = pammod(x,M); % Modulate. % Send modulated signal through AWGN channel. % Loop over different SNR values. for jj = 1:length(snr) ynoisy(:,jj) = awgn(real(y),snr(jj),'measured'); end z = pamdemod(ynoisy,M); % Demodulate.
% Compute symbol error rate from simulation. [num,rt] = symerr(x,z);
% 3. Plot empirical results, in same figure. hold on; semilogy(EbNo,rt,'b.'); legend('Theoretical SER','Empirical SER'); title('Comparing Theoretical and Empirical Error Rates'); hold off
This works but if I change the PAMMOD and PAMDEMOD with PSKMOD and PSKDEMOD the curves look very strange. Any idea to do this? Thanks a lot!
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Test and Measurement finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!