-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprak_fm.m
131 lines (109 loc) · 4.04 KB
/
prak_fm.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
clear all;
close all;
% Percobaan 2.1 Melihat Sinyal Termodulasi FM
fm=10; %Frekuensi sinyal informasi
fc=80; %Frekuensi sinyal carrier
t=0:0.0001:0.5;
Ai =20 %amplitudo sinyal informasi
m=Ai*cos(2*pi*fm*t); % sinyal informasi
figure('Name','Percobaan 2.1 Melihat Sinyal Termodulasi FM')
subplot(3,1,2);
plot(t,m); xlabel('Time'); ylabel('Amplitudo');
title('Message Signal'); grid on;
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
subplot(3,1,1);
plot(t,c); xlabel('Time'); ylabel('Amplitudo');
title('Carrier Signal'); grid on;
y=Ac*cos(2*pi*fc*t+(m));
subplot(3,1,3);
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title('FM Signal'); grid on;
% 2.2 Pengaruh Frekuensi pada Sinyal Termodulasi FM
fm=10;
figure('Name','2.2.1. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,2,1);
fc=10;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
figure('Name','2.2.2. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,2,2);
fc=20;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
figure('Name','2.2.3. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,2,3);
fc=40;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
figure('Name','2.2.4. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,2,4);
fc=80;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
fc=10
figure('Name','2.2.5. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,1,1);
fm=80;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
figure('Name','2.2.6. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
% subplot(2,1,2);
fm=30;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
Ac = 2; c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['fc: ',num2str(fc),' fm: ',num2str(fm)]); grid on;
%% 2.3 Pengaruh Amplitudo pada Sinyal Termodulasi FM
figure('Name','2.3. Pengaruh Frekuensi pada Sinyal Termodulasi FM')
subplot(3,2,1); Ac = 5; Ai =5;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);
subplot(3,2,3); Ac =5; Ai = 10;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);
subplot(3,2,5); Ac = 5; Ai =20;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);
subplot(3,2,2); Ac =10; Ai = 5;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);
subplot(3,2,4); Ac = 20; Ai =5;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);
subplot(3,2,6); Ac =20; Ai = 10;
m=Ai*cos(2*pi*fm*t); % sinyal informasi
c=Ac*cos(2*pi*fc*t); % sinyal carrier
y=Ac*cos(2*pi*fc*t+(m));
plot(t,y); xlabel('Time'); ylabel('Amplitudo');
title(['ac: ',num2str(Ac),' ai: ',num2str(Ai)]);