【Practical Exercise】MATLABASK-OOK-FSK-BPSK Filtering
发布时间: 2024-09-14 07:09:22 阅读量: 34 订阅数: 71
# 1. Introduction to Signal Filtering in MATLAB
MATLAB is a powerful numerical computing and visualization software widely used in the field of signal processing. Signal filtering is a fundamental operation in signal processing, aimed at extracting useful information or removing noise from signals. MATLAB offers a rich set of filtering functions and tools that enable users to easily implement various signal filtering operations with ease.
This chapter will introduce the basic knowledge of signal filtering in MATLAB, including the fundamental concepts of filtering, common types of filters, the use of filtering functions, and the setup of filtering parameters. Through this chapter, readers will master the basic skills of MATLAB signal filtering, laying the foundation for subsequent chapters on filter implementation and application.
# 2. Principles of OOK, FSK, BPSK Modulation and Demodulation
### 2.1 ASK and OOK Modulation and Demodulation
**ASK (Amplitude Shift Keying)**
ASK is a modulation technique that superimposes digital signals onto the amplitude of a carrier wave. A digital "0" is represented by a lower amplitude, while a digital "1" is represented by a higher amplitude.
**OOK (On-Off Keying)**
OOK is a special type of ASK where the amplitude of the carrier wave is either zero (representing digital "0") or non-zero (representing digital "1").
**Modulator**
The ASK and OOK modulators use multipliers to multiply the digital signal with the carrier. In ASK, the multiplier coefficient controls the amplitude of the carrier, whereas in OOK, the multiplier coefficient is either 0 (representing digital "0") or 1 (representing digital "1").
**Demodulator**
The ASK and OOK demodulators use envelope detectors to recover the digital signal. The envelope detector measures the amplitude of the carrier and converts it into a digital signal.
**Code Example**
```matlab
% ASK modulation
carrier = 10 * cos(2 * pi * 1000 * t);
digital_signal = [0, 1, 0, 1, 0];
modulated_signal = carrier .* digital_signal;
% ASK demodulation
demodulated_signal = abs(modulated_signal);
```
### 2.2 FSK Modulation and Demodulation
**FSK (Frequency Shift Keying)**
FSK is a modulation technique that superimposes digital signals onto the frequency of a carrier wave. A digital "0" is represented by a lower frequency, while a digital "1" is represented by a higher frequency.
**Modulator**
The FSK modulator uses a frequency converter to transform the digital signal into frequency variations. The frequency converter coefficient controls the carrier frequency, switching between two predefined frequencies based on the value of the digital signal.
**Demodulator**
The FSK demodulator uses a frequency discriminator to recover the digital signal. The frequency discriminator measures the carrier frequency and converts it into a digital signal.
**Code Example**
```matlab
% FSK modulation
carrier = 10 * cos(2 * pi * 1000 * t);
digital_signal = [0, 1, 0, 1, 0];
frequency_deviation = 100;
modulated_signal = fskmod(digital_signal, carrier, frequency_deviation);
% FSK demodulation
demodulated_signal = fskdemod(modulated_signal, carrier, frequency_deviation);
```
### 2.3 BPSK Modulation and Demodulation
**BPSK (Binary Phase Shift Keying)**
BPSK is a modulation technique that superimposes digital signals onto the phase of a carrier wave. A digital "0" is represented by a
0
0