# Amplitude Modulation (AM) Matlab Tutorial

|This tutorial explains how to create an Amplitude Modulation (AM) signal in Matlab. First thing you need to do is downloading the available code here: https://uk.mathworks.com/matlabcentral/fileexchange/56465-amplitude-modulation–am–in-time-and-frequency-domain

When running the code in Matlab, you should get the following AM signal:

Figure 1: AM signal

And its spectrum:

Figure 2: AM signal DFT

As you can see in the code,

*fs=220500 Hz*,*fc=2000 Hz*and*fm=300 Hz*.Now, remember that if you are given a signal, you can measure the periods in the AM signal and calculate those frequencies:

- For the
**carrier**frequency: measure the period of the fast oscillation. - For the
**modulation**frequency: measure the period of the slow oscillation.

Now, by measuring the maximum and minimum amplitudes you can also get the

**modulation index**:Figure 3: AM signal, measuring amplitudes

By definition:

Amax=Ac(1+m);

Amin=Ac(1-m);

Then:

Amax + Amin=2Ac;

Amax-Amin=2Ac·m;

Now, from each of both previous equations, we leave m as a function of Amax and Amin and we equal them:

m=(Amax-Amin)/(Amax+Amin)

Therefore:

m=0.7335

Which is roughly the same value than we use for our calculation: **y(t)=Ac(1+mx(t))sin(2*pi*fp*t); **

We hope you find useful this post. As you can see, AM signals are very easy to generate. In our next post,

**we will see a**Frequency Modulation**(FM) tutorial in Matlab**.