Skip to content

Commit 2b5ef10

Browse files
Merge pull request #3 from baptu123/patch-1
update the comments.
2 parents 2f746bf + 26497f0 commit 2b5ef10

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

amplitude.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
function am = amplitude
22

3-
Ac = input('Enter the value of carrier amplitude: ');
3+
Ac = input('Enter the value of carrier amplitude: ');
44
m = input('Enter the value of modulation index: ');
55
fc = input('Enter the value of carrier frequency: ');
66
fm = input('Enter the value of message signal frequency: ');
77

8-
Tfm = 1/fm;
9-
Tfc = 1/fc;
8+
Tfm = 1/fm; % Time-period of message signal.
9+
Tfc = 1/fc; % Time-eriod of carrier signal
1010

1111
t1 = 0:Tfm/999:6*Tfm;
12-
t2 = 0:Tfc/999:6*Tfc;
12+
t2 = 0:Tfc/999:6*Tfc; % while plotting carrier signal so that it is scaled to it's time period
1313

14-
carrier_wave = Ac*sin(2*pi*fc*t2);
14+
carrier_wave = Ac*sin(2*pi*fc*t2); % initializing the carrier wave and plotting it
1515
subplot(3,1,1)
1616
plot(t2, carrier_wave, 'r');
1717
title('carrier signal');
1818

19-
message_wave = (Ac*m)*sin(2*pi*fm*t1);
19+
message_wave = (Ac*m)*sin(2*pi*fm*t1); % initializing the message signal and plotting it.
2020
subplot(3,1,2)
2121
plot(t1, message_wave, 'b');
2222
title('Message Signal');
2323

24-
am = Ac*(1+m.*sin(2*pi*fm*t1)).*sin(2*pi*fc*t1);
24+
am = Ac*(1+m.*sin(2*pi*fm*t1)).*sin(2*pi*fc*t1); %initializing the amplitude modulated wave and plotting it.
2525
subplot(3,1,3)
2626
plot(t1, am, 'g');
2727
title('Amplitude Modulated Wave');
28-
grid on;
28+
grid on; % turning the grid on so that it the values can be found out easily.
2929

3030
end

0 commit comments

Comments
 (0)