Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Nz=[0.18 -0.11];
  2. Dz=[1 -0.9 0.81];
  3. n=[0:50];
  4. x=cos(0.8*pi*n + pi/5)+3*sin(0.1*pi*n);
  5. y= filter(Nz,Dz,x);
  6. subplot(2,2,1);
  7. plot(n,x);
  8. title('vhoden signal');
  9. xlabel('otcheti na vremeto');
  10. grid;
  11. subplot(2,2,2);
  12. plot(n,y);
  13. K=1024;
  14. Px=fft(x,K);
  15. px1=abs(Px(1:K/2));
  16. f=(0: (length(Px)-1)/2)';
  17.  
  18. subplot(2,2,3);
  19. plot(f,px1);
  20. grid; xlabel('Otcheti na chestotata f');
  21. title('Amplt spek na signala');
  22.  
  23. Px=fft(y,K);
  24. px1=abs(Px(1:K/2));
  25. f=(0: (length(Px)-1)/2)';
  26.  
  27. subplot(2,2,4);
  28. plot(f,px1);
  29. grid; xlabel('Otcheti na chestotata f');
  30. title('Amplt spek na signala');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement