Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. fs = 200;
  2. n = 1:200;
  3. nrx = -100:99;
  4. w = 2*pi;
  5. ran = 90*randn();
  6. x = sin(w*n/fs + ran) ;
  7. Rn = (1/2)*cos(w*nrx/fs);
  8. nr = -199:199;
  9. figure
  10. for k=1:2:10
  11. R = xcorr(x);
  12. subplot(5,2,k);
  13. plot(nr,R);
  14. axis([-100 100 -100 100]);
  15. title(['w =',num2str(w),' ran =',num2str(ran)]);
  16. w = w + (k-1.5)*pi;
  17. ran = ran + 90*randn();
  18. end
  19. w = 2*pi;
  20. for i=2:2:10
  21. subplot(5,2,i);
  22. plot(nrx,Rn);
  23. title(['w =',num2str(w)]);
  24. w = w + (i-2.5)*pi;
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement