File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
function am = amplitude
2
2
3
- Ac = input(' Enter the value of carrier amplitude: ' );
3
+ Ac = input(' Enter the value of carrier amplitude: ' );
4
4
m = input(' Enter the value of modulation index: ' );
5
5
fc = input(' Enter the value of carrier frequency: ' );
6
6
fm = input(' Enter the value of message signal frequency: ' );
7
7
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
10
10
11
11
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
13
13
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
15
15
subplot(3 ,1 ,1 )
16
16
plot(t2 , carrier_wave , ' r' );
17
17
title(' carrier signal' );
18
18
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.
20
20
subplot(3 ,1 ,2 )
21
21
plot(t1 , message_wave , ' b' );
22
22
title(' Message Signal' );
23
23
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.
25
25
subplot(3 ,1 ,3 )
26
26
plot(t1 , am , ' g' );
27
27
title(' Amplitude Modulated Wave' );
28
- grid on ;
28
+ grid on ; % turning the grid on so that it the values can be found out easily.
29
29
30
30
end
You can’t perform that action at this time.
0 commit comments