Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
80
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(fc,u)
  2. %Message Signal
  3. Am = 5;
  4. fm = fc/100;
  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. Mc = Ac*cos(2*pi*fc*t);
  11.  
  12. Mm = Mc.*Mt;
  13.  
  14. tt = Mm.*Mc;
  15. [b,a] = butter(5,fm/(fc/2),'low');
  16. Og = filter(b,a,tt);
  17.  
  18. subplot(4,1,1)
  19. plot(t,Mt)
  20. title("Message")
  21.  
  22. subplot(4,1,2)
  23. plot(t,Mc)
  24. title("Carrier")
  25.  
  26. subplot(4,1,3)
  27. plot(t,Mm)
  28. title("Modulation")
  29.  
  30. subplot(4,1,4)
  31. plot(t,Og)
  32. title("Original Signal")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement