Advertisement
worms005

test-widmo

Dec 9th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.29 KB | None | 0 0
  1. fs=1723;
  2. f=3013;
  3. fp=3446 %przynajmniej 2 razy wieksza
  4. N=1000;
  5. A=1;
  6. t=0:1/N:(N-1)/fp;
  7. x=A*sin(2*pi*f*t); % sygnal sinusoidalny
  8. subplot(2,1,1)
  9. plot(t,x)
  10. title 'Sygnal'
  11. subplot(2,1,2)
  12. X=fft(x) %transformata
  13. y=20*log10(abs(X)) %przejscie do skali decybeli
  14. plot(fs,y);
  15. title 'Widmo'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement