Skip to content

Commit bd11d7d

Browse files
Add files via upload
1 parent 9c68a01 commit bd11d7d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

amplitude.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
function am = amplitude
2+
3+
Ac = input('Enter the value of carrier amplitude: ');
4+
m = input('Enter the value of modulation index: ');
5+
fc = input('Enter the value of carrier frequency: ');
6+
fm = input('Enter the value of message signal frequency: ');
7+
8+
Tfm = 1/fm;
9+
Tfc = 1/fc;
10+
11+
t1 = 0:Tfm/999:6*Tfm;
12+
t2 = 0:Tfc/999:6*Tfc;
13+
14+
carrier_wave = Ac*sin(2*pi*fc*t2);
15+
subplot(3,1,1)
16+
plot(t2, carrier_wave, 'r');
17+
title('carrier signal');
18+
19+
message_wave = (Ac/m)*sin(2*pi*fm*t1);
20+
subplot(3,1,2)
21+
plot(t1, message_wave, 'b');
22+
title('Message Signal');
23+
24+
am = Ac*(1+m.*sin(2*pi*fm*t1)).*sin(2*pi*fc*t1);
25+
subplot(3,1,3)
26+
plot(t1, am, 'g');
27+
title('Amplitude Modulated Wave');
28+
grid on;
29+
30+
end

0 commit comments

Comments
 (0)