【Basic】Signal Modulation and Demodulation in MATLAB: Implementing AM, FM, and PM Modulation
发布时间: 2024-09-14 05:44:32 阅读量: 35 订阅数: 62
## 2.1 The Principle and Mathematical Model of AM Modulation
Amplitude Modulation (AM) is a modulation technique that superimposes the information signal onto the amplitude of the carrier signal. The mathematical model is as follows:
```
s(t) = A_c(1 + m(t))cos(2πf_c t)
```
Where:
* `s(t)` is the modulated signal
* `A_c` is the amplitude of the carrier signal
* `m(t)` is the modulation signal
* `f_c` is the frequency of the carrier signal
The modulation index `m` represents the degree of change in the amplitude of the modulation signal relative to the amplitude of the carrier signal. When `m = 0`, the modulation signal does not affect the carrier signal; when `m > 0`, the modulation signal causes changes in the amplitude of the carrier signal.
## 2. Amplitude Modulation (AM)
### 2.1 The Principle and Mathematical Model of AM Modulation
Amplitude Modulation (AM) is a modulation technique that superimposes the amplitude variations of an analog signal onto the amplitude of a carrier signal. The resulting signal is called the amplitude-modulated signal.
**Mathematical Model:**
The mathematical model for an AM-modulated signal is:
```
s(t) = A_c(1 + m(t))cos(2πf_c t)
```
Where:
* `s(t)` is the amplitude-modulated signal
* `A_c` is the amplitude of the carrier signal
* `m(t)` is the modulation signal
* `f_c` is the frequency of the carrier signal
**Modulation Index:**
The modulation index (m) is defined as the ratio of the peak amplitude of the modulation signal to the amplitude of the carrier signal:
```
m = (A_m / A_c) * 100%
```
Where:
* `A_m` is the peak amplitude of the modulation signal
The modulation index determines the degree of modulation of the amplitude-modulated signal. When the modulation index is small, the amplitude variations of the amplitude-modulated signal are small, known as **undermodulation**. When the modulation index is large, the amplitude variations are large, known as **overmodulation**.
### 2.2 Implementation of AM Modulator and MATLAB Simulation
**Implementation of AM Modulator:**
An AM modulator can be implemented in several ways:
***Balanced Modulator:** A balanced modulator can achieve high linearity in AM modulation.
***Amplifier Modulator:** An amplifier modulator can achieve cost-effective AM modulation.
***Diode Modulator:** A diode modulator can achieve simple AM modulation.
**MATLAB Simulation:**
MATLAB can be used to conveniently simulate the AM modulation process. The following code demonstrates how to use MATLAB to simulate AM modulation:
```matlab
% Define carrier signal parameters
f_c = 1000; % Carrier frequency
A_c = 1; % Carrier amplitude
% Define modulation signal parameters
f_m = 100; % Modulation frequency
A_m = 0.5; % Modulation amplitude
% Generate carrier signal
t = 0:0.001:1;
carrier = A_c * cos(2*pi*f_c*t);
% Generate modulation signal
modulating_signal = A_m * cos(2*pi*f_m*t);
% Perform AM modulation
modulated_signal = A_c * (1 + modulating_signal) .* cos(2*pi*f_c*t);
% Plot signals
figure;
subplot(3,1,1);
plot(t, carrier);
title('Carrier Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(3,1,2);
plot(t, modulating_signal);
title('Modulation Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(3,1,3);
plot(t, modulated_signal);
title('Amplitude-Modulated Signal');
xlabel('Time (s)');
ylabel('Amplitude');
```
**Code Logic Analysis:**
* Lines 1-6: Define the parameters for the carrier and modulation signals.
* Lines 7-9: Generate the carrier signal.
* Lines 10-12: Generate the modulation signal.
* Lines 13-15: Perform AM modulation.
* Lines 17-28: Plot the signal waveforms.
## 3.1 The Principle and Mathematical Model of FM Modulation
**Principle of FM Modulation**
Frequency Modulation (FM) is a modulation technique where the frequency of the carrier signal varies according to the amplitude variations of the modulation signal. The greater the amplitude of the modulation signal, the greater the deviation of the carrier signal frequency from the center frequency.
The principle of FM modulation is based on the fact that frequency variations
0
0