Frequency Modulation in Simulink: Communications 1 Laboratory
Frequency Modulation in Simulink: Communications 1 Laboratory
ACTIVITY 7
Introduction:
Frequency modulation is a technique wherein the frequency of the carrier signal is varied
using the variation in the instantaneous values of the modulating signal.
For a single-tone (single frequency) modulating signal, the expression can be reduced to
There are various ways in which an FM signal can be generated electronically using
amplifiers, oscillators, and filters. For this activity, you are going to synthesize an AM signal using
mathematical operations like addition, integration, amplification (amplitude scaling) and trigonometric
function.
Procedure:
2. Show all block names. To show the Block Name, right click on the block and then click
Format, select Show Block Name and then set it to On.
4. We are going to simulate a frequency modulator with 𝑚(𝑡) = 0.5 sin (2𝜋 2𝑡) and
𝑐(𝑡) = (1) sin(2𝜋 20𝑡) using a modulation index of 𝑚𝑖 = 5.00. Click on each of the block
and set the following parameters.
Gain: 5
Gain1 (fm/Vm):
Gain: 2/0.5
Gain2 (2*pi):
Gain: 2*pi
5. Set the Stop Time to 3 seconds and then Run the simulation.
6. Double click on the Scope. Copy the figure (Ctrl+C) and paste it inside the box shown
below.
8. Add To Workspace Blocks to the block diagram. A To Workspace Block imports simulation
data to Matlab Workspace.
9. By default, the variable names of the To Workspace Blocks are simout and simout1
respectively. Rename the To Workspace Blocks variable names to fm and m respectively. To
rename variables, double click on each block and type the new variable names.
10. Set the Stop Time to 3 seconds and then Run the simulation.
12. Go to Matlab Workspace. You will see three variables created. The variable out is the data
exported from Simulink.
13. Double-click on the three-variables. Matlab will open a variable viewer similar to a
spreadsheet viewer (Excel). Click on the highlighted (red) items.
14. The variable viewer will show a two-column data for out.m and out.fm. The data on the
first column are the time samples and the data on the second column are the signal
instantaneous values.
15. Copy the content of out.m (Ctrl+A then Ctrl+C) to variable m (Ctrl+V).
16. Copy the content of out.fm (Ctrl+A then Ctrl+C) to variable fm (Ctrl+V).
17. Steps 15 and 16 exports the content of out.m to regular variables m and fm.
18. Open the M-File fmmapua.m. Run the script.
Fs=1000; %sampling frequency
figure(1);
plot(m(:,1),m(:,2)); grid on;
xlabel('Time(sec)');
ylabel('Amplitude')
title('Modulating Signal')
figure(2);
plot(fm(:,1),fm(:,2)); grid on
xlabel('Time(sec)');
ylabel('Amplitude')
title('FM Signal')
figure(3)
M = abs(fft(m(:,2))/Fs);
stem(f1,M); grid on
xlabel('Frequency(Hz)');
ylabel('Amplitude')
title('Frequency Spectrum of the Modulating Signal')
figure(4)
M = abs(fft(fm(:,2))/Fs);
stem(f2,M); grid on
grid on
xlabel('Frequency(Hz)');
ylabel('Amplitude')
title('Frequency Spectrum of FM Signal')
19. The M-File plots the modulating signal and FM signal vs. time (Figure 1 and Figure 2). It
also takes the magnitude of the Fast-Fourier Transform (FFT) of the two signals and plots
them vs frequency (Figure 3 and Figure 4).
20. Copy Figure 1 and Figure 2 and paste it inside the boxes shown below. To copy the figure
click Edit and then click Copy Figure from the figure toolbar.
Figure 1
Figure 2
21. Maximize the Figure 3 window. Locate the Zoom In command on the upper right corner
of the figure.
22. Zoom In on the waveform until it shows 0 Hz to 10 Hz on the x-axis and 0 to 0.8 on the y-
axis. Copy the figure below.
Figure 3
23. Maximize the Figure 4 window. Zoom In on the waveform until it shows 0 Hz to 40 Hz on
the x-axis and 0 to 0.6 on the y-axis. Copy the figure below.
Figure 4
24. Describe the waveform in Figure 3. How many distinct frequency(ies) does the
modulating signal contains? Explain why?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
25. Describe the waveform in Figure 4. How many distinct frequency(ies) does the FM signal
contains? Explain why?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
26. Using a multiplexer, view the Modulating Signal and FM signal waveforms
simultaneously.
27. Set the Stop Time to 3 seconds and then Run the simulation.
28. Double-click on the scope. Copy the figure (Ctrl+C) and paste it inside the box.
𝑚𝑖 = 5.00
29. On the graph, you will see the modulating signal and the FM signal on the same set of axes.
At the positive peak (maximum) of the modulating signal, the frequency of FM signal (A) is
high (period is small), while at the negative peak (minimum), the frequency of FM signal (B)
is low (period is large).
30. Zoom In on the portion of the waveform labeled A. Measure the time at zero crossings.
31. Zoom In on the portion of the waveform labeled B. Measure the time at zero crossings.
32. Tabulate your measurements and calculate the corresponding periods and frequencies at A
and B.
𝑇 1
𝑡1 𝑡2 = 𝑡2 − 𝑡1 𝑇 𝑓=
2 𝑇
A
B
𝑓𝐴 −𝑓𝑐
33. Calculate the modulation index using the formula 𝑚𝑖 = 𝑓𝑚
. Calculate the modulation
𝑓𝑐 −𝑓𝐵
index using the formula 𝑚𝑖 = 𝑓𝑚
where 𝑓𝑚 = 2 𝐻𝑧 and 𝑓𝑐 = 20 𝐻𝑧 are the modulating
frequency and the carrier frequency respectively. Compare the calculated values to the preset
values.
𝑓𝐴 − 𝑓𝑐 𝑓𝑐 − 𝑓𝐵
𝑚𝑖 𝑚𝑖 = . 𝑚𝑖 =
𝑓𝑚 𝑓𝑚
5.00
3.00
8.00
34. Repeat steps 27 to 33 using 𝑚𝑖 = 3.00. Tabulate your answers on the table below.
𝑇 1
𝑡1 𝑡2 = 𝑡2 − 𝑡1 𝑇 𝑓=
2 𝑇
A
B
35. Calculate the modulation index. Tabulate your answers on the table shown on step 33.
36. Copy the figure (Ctrl+C) and paste it inside the box.
𝑚𝑖 = 3.00
37. Repeat steps 27 to 33 using 𝑚𝑖 = 8.00. Tabulate your answers on the table below.
𝑇 1
𝑡1 𝑡2 = 𝑡2 − 𝑡1 𝑇 𝑓=
2 𝑇
A
B
38. Calculate the modulation index. Tabulate your answers on the table shown on Step 33.
39. Copy the figure (Ctrl+C) and paste it inside the box.
𝑚𝑖 = 8.00