Modulation and demodulation simulation of BFSK based on MATLAB
It's a dream 2021-06-04 10:47:47

## Write it at the front

This is 【Matlab】BASK The simulation of modulation and demodulation of The second part of , Considering the reading experience , So I'm going to open another article to share BFSK The simulation of modulation and demodulation of .

## Indexes

• Write it at the front
• One 、BFSK Modulation of
• 1.1 Different frequency carrier generation
• 1.2 Signal combination
• 1.3 Waveform Preview
• 1.4 Parameter setting （ Reference resources ）
• Two 、BFSK Demodulation of
• 2.1 Model structures,
• 2.2 Waveform Preview
• 2.3 Parameter setting （ Reference resources ）
• 3、 ... and 、 common problem
• At the end

## One 、BFSK Modulation of

One FSK The signal can be seen as two different carriers BASK Superposition of signals ,BFSK The spectrum of the signal can be seen as $$f_1$$ and $$f_2$$ Two BASK The combination of spectrum .

Frequency shift keying is the use of carrier frequency to transmit digital signals , stay BFSK in , The carrier frequency varies with the binary baseband signal $$f_1$$ and $$f_2$$ Between two frequency points , Frequency shift keying (FSK) uses the frequency shift of carrier to transmit digital information . So the expression is ：

$e_{BFSK}(t)= \begin{cases} A\cos{(\omega_1t+\phi_n)}\\ A\cos{(\omega_2t+\theta_n)}\\ \end{cases}$

BFSK There are two kinds of modulation modes of the , They are analog frequency modulation and keying . This article uses keying , adopt Simulink Conduct simulation . The schematic diagram of the keying method is shown in the figure below ： Let's use Matlab/Simulink Implement the model step by step .

### 1.1 Different frequency carrier generation

according to BFSK Signal expression , We need to prepare two different frequency carriers . In order to generate different frequency carrier , We will BASK In modulation model Signal Geneator Replace with Sine Wave. in addition , In order to reflect 01 Characteristics of signal , 需要使曼彻斯特码的其 in One 通道经过非门 NOT, And then through the multiplier . Above picture , adopt Product 0b The generated signal represents binary 0 Carrier of , adopt Product 1b The generated signal represents binary 1 Carrier of .Scope The waveforms of are shown in the figure below ： ### 1.2 Signal combination

Observe 1.1 Oscillogram in , We can easily draw a conclusion ：BFSK The modulation signal is generated by the 0 code BFSK Modulation signal and 1 code BFSK Sum of modulated signals . So we let two different frequency carriers pass through Sum You can get the complete BFSK Modulation signal .
For model visibility , I will 0 code BFSK Modulation signal and 1 code BFSK The modulation signal is packaged . ### 1.3 Waveform Preview

Use Scope modular , We can observe the waveform of the signal in each stage . Put the Manchester code and BFSK The modulated signal is connected to the oscilloscope , We can see the figure below ： ### 1.4 Parameter setting （ Reference resources ）

We can adjust the parameters of each module to control BFSK Shape of modulated signal , The reference parameters of each module are given below ：

Module name Parameters Set the value
Pulse Generator Period (secs) 1
Pulse Width (% of period) 50
Sine Wave 0b Frequency (rad/sec) 12*pi
Sine Wave 1b Frequency (rad/sec) 24*pi

notes ： Module parameters not listed are processed by default .

## Two 、BFSK Modulation of

BFSK There are two ways to demodulate , They are coherent demodulation and incoherent demodulation . Coherent demodulation is used in this paper , adopt Simulink Conduct simulation . The schematic diagram of coherent demodulation is shown in the figure below ：

graph LR Input["BFSK Signal input "] BandpassFilter0b[" Bandpass filter 0b"] BandpassFilter1b[" Bandpass filter 1b"] Product1[" Multiplier "] Product2[" Multiplier "] LowpassFilter1[" low pass filter "] LowpassFilter2[" low pass filter "] SamplingDecimator[" Sampling decimator "] SamplingPulse[" Sampling pulse "] Cosine0b["Cosine Wave 0b"] Cosine1b["Cosine Wave 1b"] Output["BFSK Demodulation signal output "] Input --> BandpassFilter0b --> Product1 --> LowpassFilter1 --> SamplingDecimator --> Output Input --> BandpassFilter1b --> Product2 --> LowpassFilter2 --> SamplingDecimator SamplingPulse --> SamplingDecimator Cosine0b --> Product1 Cosine1b --> Product2

Let's use Matlab/Simulink Implement the model step by step .

### 2.1 Model structures,

stay Simulink in , We can use Analog Filter Design To replace band-pass filter and low-pass filter , use Sine Wave Output same frequency demodulation carrier , use GreaterThanOrEqual Instead of sampling decider and sampling pulse . The specific model is as follows ： ### 2.2 Waveform Preview

Use Scope modular , We can observe the waveform of the signal in each stage . Manchester code 、BFSK Modulation signal and BFSK The demodulated signal is connected to the oscilloscope , We can see the figure below ： ### 2.3 Parameter setting （ Reference resources ）

The reference parameters of each module are given below ：

Module name Custom name Parameters Set the value
Analog Filter Design Bandpass Filter 0b Filter type Bandpass
Lower passband edge frequency (rad/s) 12*pi-20
Upper passband edge frequency (rad/s) 12*pi+20
Bandpass Filter 1b Filter type Bandpass
Lower passband edge frequency (rad/s) 24*pi-20
Upper passband edge frequency (rad/s) 24*pi+20
Lowpass Filter 0b Passband edge frequency (rad/s) 10*pi
Lowpass Filter 1b Passband edge frequency (rad/s) 23*pi
Sine Wave Sine Wave Frequency (rad/sec) 12*pi
GreaterThanOrEqual GreaterThanOrEqual Relational operator <

notes ： Module parameters not listed are processed by default .

## 3、 ... and 、 common problem

Q： Sine wave distortion is encountered during simulation （ Including amplitude and shape ）, What to do with ？
A： If sine wave distortion is encountered in the simulation process （ Including amplitude and shape ）, Can be in Simulink Right click the blank space of the project , choice Model Configuration Parameters, After entering the page , On the tab Solver -> Solver details The following parameters are set in ：

Parameters Set the value
Max step size 1e-5
Relative tolerance 1e-5

.

## At the end

It's been a busy few weeks , It took a day to finish this article , But I had to finish it by Thursday Orz