Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. clear all; clc;close all;
  2. Rs=1e6;fs=20e6;phi=pi/2; Es=2;SNR=10; m=16;
  3. v=randi(1,1000,m);
  4. qam=qammod(v,m);
  5. st=awgn(qam,SNR,'measured');
  6. giaima=qamdemod(st,m);
  7. [t,st1]=taoxung(qam,Es,phi,Rs,fs);
  8. plot(t(1:1000),st1(1:1000));
  9. figure;
  10. st2=awgn(st1,SNR,'measured');
  11. plot(t(1:1000),st2(1:1000));
  12. figure;
  13. sf1=fft(st1,length(st1));
  14. f=0:1/(max(t)-min(t)):fs;
  15. sf2=fftshift(sf1);
  16. plot(f,sf2)
  17. figure;
  18. sf3=fft(st2,length(st2));
  19. sf4=fftshift(sf3);
  20. plot(f,sf4);
  21. h=scatterplot(st,1,0);
  22. hold on
  23. scatterplot(qam,1,0,'ro',h);
  24. eyediagram(st1,100);
  25. eyediagram(st2,100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement