Facebook
From Colorant Gorilla, 9 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 96
  1. n=500;
  2. x=randi([0 15],1,n); %500 random characters
  3.  
  4. %modulation
  5. y = qammod(x,16); %signal generation for QAM16 modulation
  6.  
  7.  
  8.  
  9.  
  10. % for i=1:30
  11. %     y_noise = awgn(y,i,'measured'); %add white Gousian Noise SNR 30 dB
  12. %     z = qamdemod(y_noise,16); %signal demodulation
  13. % blad_16(1,i)=nnz(z-x) / length(x) * 100; %non zero is error
  14. % end
  15.  
  16. for i=1:30
  17.     y_noise(i,:) = awgn(y,i,'measured'); %add white Gousian Noise SNR 30 dB
  18.     z(i,:) = qamdemod(y_noise(i,:),8); %signal demodulation
  19. blad_8(1,i)=nnz(z(i,:)-x) / length(x) * 100; %non zero is error
  20. end
  21.  
  22. % for i=1:30
  23. %     y_noise = awgn(y,i,'measured'); %add white Gousian Noise SNR 30 dB
  24. %     z = qamdemod(y_noise,2); %signal demodulation
  25. % blad_2(1,i)=nnz(z-x) / length(x) * 100; %non zero is error
  26. % end
  27.  
  28.  
  29. figure,
  30. plot([1:30],blad_8,'r-');
  31.