Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. function [  ] = CPSLAB1( )
  2.  
  3.  
  4. f1=290;
  5. f2=444;
  6.  
  7. fs=3000;
  8. td=1/fs;
  9.  
  10. t=0:td:0.1;
  11. sinusek=sin(2*pi*f1*t)+sin(2*pi*f2*t)+1;
  12. figure(1)
  13. subplot(3,1,1); plot(t,sin(2*pi*f1*t));
  14. subplot(3,1,2); plot(t,sin(2*pi*f2*t));
  15. subplot(3,1,3); plot(t,sinusek);
  16. Y = fft(sinusek);
  17. dlugosc=length(Y);
  18. f=linspace(0,fs,dlugosc);
  19.  
  20. figure(2)
  21. plot(f,abs(Y));
  22.  
  23.  
  24.  
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement