Advertisement
Stybyk

FSK

Nov 11th, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.50 KB | None | 0 0
  1. t = 0:1/18000:((200/18000)-(1/18000));
  2. f = zeros(1,200);
  3. f1 = 1200;
  4. f2 =  1800;
  5. f(1:2)= f1;
  6. f(3)= f2 ;
  7. f(4)= f1 ;
  8. f(5:6)= f2 ;
  9. f(7:8)= f1 ;
  10. f(8:10) = f2;
  11. f(11)= f1;
  12. f(12)= f2;
  13. f(13:20) = f1;
  14. f(21:25) = f2;
  15. f(26:45) = f1;
  16. f(46:50) = f2;
  17. f(51:100)= f1;
  18. f(101:200)= f2;
  19.  
  20.  
  21. signal = 2* cos(2*pi*f.*t);
  22. subplot(2,1,1)
  23. plot(t,signal)
  24. grid
  25. xlabel("Time")
  26. ylabel("Amplitude")
  27. subpot(2,1,2)
  28.  
  29. subplot(2,1,2)
  30. furier = fft(signal);
  31. plot(t,abs(furier))
  32. grid
  33. xlabel("Frequency")
  34. ylabel("Amplitude")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement