Advertisement
Narayan

signal

Oct 29th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.45 KB | None | 0 0
  1. clear
  2. clc
  3. u = 0.6;
  4. fc = 300e3;
  5. fs = 10e3;
  6. T = 1/fs;
  7. t=[0:1/(180*fc):T-eps];
  8. m = cos (2*pi*fs*t);
  9. c = cos (2*pi*fc*t);
  10. s_dsb = m.*c;
  11. s_am = (1+u*m).*c;
  12. figure (1);
  13. subplot (2,1,1);
  14. title('Modulated plot of a cos signal');
  15. xlabel('time [s]');
  16. ylabel('Amplitude [V]');
  17. plot (t, s_dsb, t, m);
  18. f_s_am = fft (s_dsb);
  19. subplot (2,1,2);
  20. plot (t, f_s_am, 'linewidth', 2);
  21. figure (2);
  22. xlabel ('time [s]');
  23. ylabel ('Amplitude [V]');
  24. plot (t, s_am,t, m);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement