th0m45s5helby

DC augmented

Feb 25th, 2021
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. clc %for clearing the command window
  2. close all %for closing all the window except command window
  3. clear all %for deleting all the variables from the memory
  4. t=0:.001:1; % For setting the sampling interval
  5. fc=input('Enter frequency of Carrier Sine wave: ');
  6. fm=input('Enter Message frequency : ');
  7. amp=input('Enter Carrier & Message Amplitude(Assuming Both Equal):');
  8. c=amp.*sin(2*pi*fc*t);% Generating Carrier Sine
  9. subplot(3,1,1) %For Plotting The Carrier wave
  10. plot(t,c)
  11. xlabel('Time')
  12. ylabel('Amplitude')
  13. title('Carrier')
  14. m=square(2*pi*fm*t);% For Plotting Message signal
  15. subplot(3,1,2)
  16. plot(t,m)
  17. xlabel('time')
  18. ylabel('ampmplitude')
  19. title('Message Signal')% Sine wave multiplied with square wave in order to generate PSK
  20. x=c.*m;
  21. subplot(3,1,3) % For Plotting PSK (Phase Shift Keyed) signal
  22. plot(t,x)
  23. xlabel('t')
  24. ylabel('y')
  25. title('PSK')
Advertisement
Add Comment
Please, Sign In to add comment