Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function freq_rate(f,u)
  2. %Message Signal
  3. Am = 5;
  4. fm = 2000;
  5. t = 0:(1/(fm*999)):6/fm;
  6. Mt = Am*sin(2*pi*fm*t);
  7.  
  8. %Carrier Signal
  9. Ac = Am/u;
  10. fc = f;
  11. Mc = Ac*cos(2*pi*fc*t);
  12.  
  13. Mm = Mc.*Mt;
  14.  
  15. tt = Mm.*Mc;
  16. [b,a] = butter(Am,0.5,'low');
  17. Og = filter(b,a,tt);
  18.  
  19. subplot(4,1,1)
  20. plot(t,Mt)
  21. title("Message")
  22.  
  23. subplot(4,1,2)
  24. plot(t,Mc)
  25. title("Carrier")
  26.  
  27. subplot(4,1,3)
  28. plot(t,Mm)
  29. title("Modulation")
  30.  
  31. subplot(4,1,4)
  32. plot(t,Og)
  33. title("Original Signal")
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement