krolyxon revised this gist 1 month ago. Go to revision
1 file changed, 42 insertions, 1 deletion
amplitude_modulation.m
| @@ -1 +1,42 @@ | |||
| 1 | - | clc; clear all; close all; fs = 1000 ; t = 0:0.0001:0.1 ; Am = 1 ; Ac = 2; fm = 50 ; fc = 500 ; Ka = 0.5 ; msg=Am*cos(2*pi*fm*t); carr=Ac*cos(2*pi*fc*t); amw=Ac*(Ka*msg).*cos(2*pi*fc*t); subplot(3,1,1); plot(t,msg); xlabel('t'); ylabel('m(t)'); title('modulating signal') subplot(3,1,2); plot(t,carr); xlabel('t'); ylabel('c(t)'); title('carrier signal') subplot(3,1,3); plot(t,amw); xlabel('t'); ylabel('amw(t)'); title('modulated signal') | |
| 1 | + | clc; | |
| 2 | + | clear all; | |
| 3 | + | close all; | |
| 4 | + | ||
| 5 | + | fs = 1000; | |
| 6 | + | t = 0:0.0001:0.1; | |
| 7 | + | ||
| 8 | + | Am = 1; | |
| 9 | + | Ac = 2; | |
| 10 | + | ||
| 11 | + | fm = 50; | |
| 12 | + | fc = 500; | |
| 13 | + | ||
| 14 | + | Ka = 0.5; | |
| 15 | + | ||
| 16 | + | % Modulating signal | |
| 17 | + | msg = Am * cos(2 * pi * fm * t); | |
| 18 | + | ||
| 19 | + | % Carrier signal | |
| 20 | + | carr = Ac * cos(2 * pi * fc * t); | |
| 21 | + | ||
| 22 | + | % AM Wave | |
| 23 | + | amw = Ac * (Ka * msg) .* cos(2 * pi * fc * t); | |
| 24 | + | ||
| 25 | + | % Plotting | |
| 26 | + | subplot(3,1,1); | |
| 27 | + | plot(t, msg); | |
| 28 | + | xlabel('t'); | |
| 29 | + | ylabel('m(t)'); | |
| 30 | + | title('Modulating Signal'); | |
| 31 | + | ||
| 32 | + | subplot(3,1,2); | |
| 33 | + | plot(t, carr); | |
| 34 | + | xlabel('t'); | |
| 35 | + | ylabel('c(t)'); | |
| 36 | + | title('Carrier Signal'); | |
| 37 | + | ||
| 38 | + | subplot(3,1,3); | |
| 39 | + | plot(t, amw); | |
| 40 | + | xlabel('t'); | |
| 41 | + | ylabel('amw(t)'); | |
| 42 | + | title('Modulated Signal'); | |
krolyxon revised this gist 1 month ago. Go to revision
1 file changed, 1 insertion
amplitude_modulation.m(file created)
| @@ -0,0 +1 @@ | |||
| 1 | + | clc; clear all; close all; fs = 1000 ; t = 0:0.0001:0.1 ; Am = 1 ; Ac = 2; fm = 50 ; fc = 500 ; Ka = 0.5 ; msg=Am*cos(2*pi*fm*t); carr=Ac*cos(2*pi*fc*t); amw=Ac*(Ka*msg).*cos(2*pi*fc*t); subplot(3,1,1); plot(t,msg); xlabel('t'); ylabel('m(t)'); title('modulating signal') subplot(3,1,2); plot(t,carr); xlabel('t'); ylabel('c(t)'); title('carrier signal') subplot(3,1,3); plot(t,amw); xlabel('t'); ylabel('amw(t)'); title('modulated signal') | |