# Simulating modulation & demodulation techniques in MATLAB

Before getting started with the simulation of the modulation in MATLAB, let's look at the basics of modulation, need, and different types.

Modulation

It is the process of influencing data and information on the carrier. The process of transmission and reception of information is called communication. Modulation is widely used as it improves the quality of reception and transmission, increases the range of communication, reduces the antenna dimensions, and less interference from other signals.

Types of Modulation:

The basic type of analog modulations are as follows:

1. Amplitude Modulation: The amplitude of the carrier signal is changed in proportion to the message/information signal, whereas the frequency and the phase are kept constant.
2. Frequency Modulation: The frequency of the carrier signal is altered in proportion to the message/information signal, whereas the amplitude and the phase are kept constant.
3. Phase Modulation: The phase of the carrier signal is altered in proportion to the message/information signal, whereas the amplitude and the frequency are kept constant.

The above mentioned are the basic types of modulation under the analog type. The frequency and phase are said to be of angle modulation since both of them have many similarities between them and even one can be converted to another using either a differentiator or an integrator.

Also, the modulation is classified in other categories too, like:

# Simulating Amplitude Modulation:

The voltage is directly proportional to the modulating signal which is added to the carrier amplitude. The sinusoidal amplitude modulation is:

MATLAB Code:

Output:

For different modulation index (m):

Output:

m < 1 → Under Modulation

m = 1 → Critical Modulation

m > 1 → Over Modulation

What to keep the parameters:

Output:

# Simulating Frequency Modulation:

Modulating signal em(t) varies with the carrier frequency. The change in frequency is directly proportional to the modulating voltage. The sinusoidal frequency modulation is:

MATLAB Code:

Output:

For different modulation index (B):

Output:

For FM, one can even use the in-built function for the Frequency modulation i.e. fmmod().

Phase Modulation:

We know that phase modulation and frequency modulation is having many similarities. We have a phase deviation constant in PM and frequency deviation constant in FM. There is an equivalence between PM and FM, hence one can easily convert PM from FM using a differentiator and, whereas FM from PM using an integrator.

Demodulation:

Once the transmission of the message signal is done using modulation techniques, it is necessary to demodulate and get back the original message signal at the receiving end. Hence demodulation can be defined as the process of extracting the original information signal. A demodulator is an electronic circuit which is mainly used to recover the message signal.

Different amplitude, frequency, phase demodulation techniques are used. Illustrating demodulation in MATLAB and SIMULINK:

Amplitude Demodulation:

Using the envelope detection method:

Output:

Also, the Hilbert transform technique can be used.