Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. clear all
  2. EbN0=12;
  3. M=2;
  4.  
  5. n=log2(M)
  6. nb_symbole=n*1e5;
  7. hmod=pskmod(M,pi/4);
  8. hmod.SymbolOrder='gray';
  9. hdemod=pskdemod(M,pi/4);
  10. hdemod.SymbolOrder='gray';
  11.  
  12. input = randi([0 M-1], nb_symbole,1);
  13. xm = modulate(hmod, input);
  14. SNR=EnB0+10+log10(n)
  15. xmnoise=awgn(xm,SNR,'measured');
  16. scatterplot(xm);grid
  17. scatterplot(xmnoise);grid
  18. ydemod = demodulate(hdemod, xmnoise);
  19. [ydemod(1:10) input(1:10)]
  20. %nb_symbole*n==nb_bits !
  21. TEB=biterr(ydemod,input)/(nb_symbole*n)
  22. BERtheory = berawgn(EbN0,'psk',M,'nondiff')
  23. BERerfc_BPSK = 1/2.*erfc(sqrt(10^(EbN0/10)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement