# Frequency Modulation (FM) Matlab Tutorial.- Part 2

|In this post we are going to apply what we learnt about the FM signal’s properties in our last post. We will do some exercises in Matlab by using the functions fmmod and fmdemod. Remember the three cases that we will study:

- fc and fm have the same values and Af will change
- fc and Af have the same values and fm will change
- Af and fm have the same values and fc will change

Ready? Let’s get started!

## EXERCISE 1: fc and fm have the same values and Af will change

Using the function fmmod study the following cases:

- fc=100 kHz and fm=1000 Hz and Af=100 Hz.
- fc=100 kHz and fm=1000 Hz and Af=500 Hz.
- fc=100 kHz and fm=1000 Hz and Af=1000 Hz.
- fc=100 kHz and fm=1000 Hz and Af=2000 Hz.
- fc=100 kHz and fm=1000 Hz and Af=5000 Hz.

When we change the value of the

**frequency deviation**, Af, we are changing the**modulation index**(named β or h):Therefore, we have the following values for the modulation index corresponding to the five values of Af:

- For Af=100 Hz, h=0.1.
- For Af=500 Hz, h=0.5.
- For Af=1000 Hz, h=1.
- For Af=2000 Hz, h=2.
- For Af=5000 Hz, h=5.

Now, according to the previous calculations we have the following

**FM spectrum in Matlab**for each case:Figure 1. FM signals’ spectrum (Group 1)

As you can observe, the properties studied in our previous posts are represented here: when

**β (also named h)**is smaller than the unit, the coefficients J0 and J1 are the ones with a significant value. You can observe, by zooming the plot, that when β is smaller than the unit, the spectrum just have two deltas and when we increase β, the number of deltas increases.When β<=1, the spectrum is formed by the

**carrier frequency and a couple of lateral frequencies**.When increasing the value of β, the number of lateral frequencies increases and the amplitude of the carrier component decreases: this happens because the signal envelope (in the time domain) is constant, according to the expression:

In addition, you can observe from the previous graph than when Af is smaller, fm is closer to fc and when increasing Af, fm and fc are everytime more separated.

## EXERCISE 2: fc and Af have the same values and fm will change

Using the function fmmod study the following cases:

- fc=100 kHz and fm=100 Hz and Af=10000 Hz.
- fc=100 kHz and fm=500 Hz and Af=10000 Hz.
- fc=100 kHz and fm=1000 Hz and Af=10000 Hz.
- fc=100 kHz and fm=5000 Hz and Af=10000 Hz.

Therefore, in this case we are modifying the modulation frequency, fm. Also, note that the parameter Af represents the change in frequency that it’s produced in the carrier when the modulation signal is applied.

In this case, we have the following values for the

**modulation index corresponding to the five values of fm**:- For fm=100 Hz, h=100.
- For fm=500 Hz, h=20.
- For fm=1000 Hz, h=10.
- For fm=5000 Hz, h=2.

The spectrum of the modulated signal will present a different number of deltas inside a bandwidth of Af; when increasing fm, the number of deltas increases and the number of deltas will decrease:

Figure 2. FM signals’ spectrum (Group 2)

If you zoom the image, you will see that

**the bandwidth, Af, is the same all the cases**(in the first one, you can’t appreciate this effect properly, due to the sampling error produced by Matlab, as we explained in this post).## EXERCISE 3: fm and Af have the same values and fc will change

Using the function fmmod study the following cases:

- fc=200 kHz and fm=11000 Hz and Af=30000 Hz.
- fc=210 kHz and fm=11000 Hz and Af=30000 Hz.
- fc=220 kHz and fm=11000 Hz and Af=30000 Hz.

Therefore, in this case, we are changing the carrier frequency. By observing the

**expression for the modulated signal in the frequency domain**, we can deduce that for different values of fc, the deltas will be placed in different frequencies:Also, if the

**frequency deviation and the frequency of the modulation signal stay constant, the phase deviation too**. In this case, you can check that β=2’73.Therefore, if β is constant we can conclude that the variation will be in the

**Bessel’s coefficients**:Figure 3. Bessel’s functions of first order

In other words, for the same value of β, the amplitudes of the Bessel’s coefficients are different.

Given a modulation index β, the first Bessel functions, J

_{0},J_{1}….J_{5 }correspond with the amplitudes of the lateral bands in the following way:- The Bessel function of order 0, J
_{0},produces a scalar which is the coefficient for the amplitude of the carrier signal. - The Bessel function of order 1, J
_{1},produces the coefficients for the amplitudes of the first bands above and below of the carrier signal. - The Bessel function of order 2, J
_{2},produces the coefficients for the amplitudes of the second bands above and below of the carrier signal, and so on. - The bigger the order, the bigger the modulation index needs to be for this frequency to have a significant amplitude.

For this case, we obtain the following spectra:

Figure 4. FM signals’ spectrum (Group 3)

This means that if our

**FM****carrier signal**is:The coefficients a

_{k}can be calculated by using the Bessel’s functions of first order and order k, as we commented above.### Conclusions

In this tutorial we have been working with some of the

**fundamental parameters of FM signals**. We have studied the spectrum because the frequency domain provides the information and variation of this parameters.If you found this tutorial useful or you have questions, please leave a comment below. Also, you can comment suggesting future topics. In the meantime, we are preparing an

**ASK Modulation Matlab tutorial**😉