0% found this document useful (0 votes)
47 views6 pages

FM Modulation & Demodulation in MATLAB

This document describes a circuit design for FM modulation and demodulation using MATLAB. The design uses MATLAB M-files to simulate the FM modulation and demodulation process. It draws the baseband signal, carrier signal, modulated signal, demodulated signal waveform, and the relationship between bit error rate and signal-to-noise ratio after modulation and demodulation through a noise channel. The design achieves FM signal simulation through modulation, transmission over a noise channel, and demodulation to observe the effects of noise.

Uploaded by

hassna ait ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views6 pages

FM Modulation & Demodulation in MATLAB

This document describes a circuit design for FM modulation and demodulation using MATLAB. The design uses MATLAB M-files to simulate the FM modulation and demodulation process. It draws the baseband signal, carrier signal, modulated signal, demodulated signal waveform, and the relationship between bit error rate and signal-to-noise ratio after modulation and demodulation through a noise channel. The design achieves FM signal simulation through modulation, transmission over a noise channel, and demodulation to observe the effects of noise.

Uploaded by

hassna ait ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Design of FM Modulation and Demodulation Circuit Based

on Matlab

Zhimin Gong,Youqi Cai,Jialu Wei


Information Engineering College, Panzhihua University of Technology, Sichuan, China

Abstract: FM is widely used in communication systems. FM is widely used in high-fidelity music broadcasting, television audio signal transmission, satellite
communications and cellular telephone systems. The design is mainly use MATLAB integrated environment M files to prepare the formula in order to achieve FM
modulation and demodulation process. Then, it will draw out of the baseband signal, carrier signal and modulated time domain waveform signal. After that, it will
draw out the superimposed signal with noise signal separately, the coherent demodulated signal and the time domain waveform of the demodulated baseband signal.
Finally, the relationship between the bit error rate and the signal-to-noise ratio after the FM baseband signal is passed through the channel and the modulation and
demodulation system will be drawn out. Then, waveform will be compared through theoretical results to analyze the correctness of the simulation modulation and
demodulation system and the impact of noise on signal demodulation. In this design, the system development platform is Windows Vista while the tools used is
MATLAB 7.0. The program was running on the platform to complete the observation of FM modulation and demodulation as well as the demodulation of the
superimposed noise. The FM signal through the noise channel, modulation and demodulation system simulation purposes was achieved through this design.
Key words: FM; modulation; demodulation; MATLAB 7.0; noise

Preface Gaussian noise channel. Analog modulation requires the program to


This circuit is designed to implement the DSB signal draw the modulation signal, carrier, modulated signal, demodulation
modulation and demodulation process. The modulation and signal waveform, digital modulation requirements to draw the bit error
demodulation of the signal plays an important role in the rate with the signal to noise ratio curve.
communication system. The modulation process is a process of
moving the spectrum by moving the spectrum of the low frequency 2.FM modulation and demodulation system design
signal to the carrier frequency position. The demodulation is the The purpose of communication is to transmit information. The
inverse of the modulation which is the process of restoring the role of a communication system is to send information from an
modulated signal to the original baseband signal. The receiving end of information source to one or more destinations. For any
the signal is to reduce the modulated signal by demodulation to read communication system, can be regarded as by the sender, channel and
the information sent by the sender. So the demodulation of the signal receiver three parts (shown in Figure 1).
on the system transmission efficiency and transmission reliability has a
great impact. Modulation and demodulation methods often determine Figure 1 General model of the communication system
the performance of a communication system. Double-side DSB signals Information source (referred as the source) is the role of a
demodulation using coherent demodulation method is widely used in variety of information into the original signal. According to the type of
carrier communication and short-wave wireless telephone message different sources are divided into analog sources and digital
communication. sources. The purpose of the transmitting device is to generate a signal
suitable for transmission, even if the characteristics of the transmitted
1.The purpose and requirements of circuit design signal match the channel characteristics. It has the ability to resist
1.1 The purpose of circuit design noise and have sufficient power to meet the needs of long-distance
The communication principle of analog signal modulation and transmission.
demodulation, digital baseband signal transmission, digital signal The information source and the sending device are collectively
modulation and demodulation, analog signal sampling, quantization referred as the sending end.
and coding together with the principle of the best reception of signals The original electrical signal of the lower frequency which is
were mastered through the 'FM modulation and demodulation system transmitted directly by the sender is called the baseband signal. The
design and simulation’ circuit design. Application of principle design baseband signal usually should not be transmitted directly in the
FM modulation and demodulation system and then carry out channel. Therefore, at the transmitting end of the communication
simulation. system, the spectrum of the baseband signal is shifted (modulated) into
the frequency range suitable for channel transmission. This is the
1.2 circuit design requirements process of modulation.
It is required to be proficient in the application of MATLAB After the signal is transmitted through the channel, the receiving
language to write basic communication system applications, analog end with the signal amplification and inverse conversion function
modulation system, digital baseband signal transmission system moves (demodulates) the modulated signal to the original frequency
modeling, design and simulation. All the simulation with MATLAB range. This is the demodulation process.
program (that is, only the form of code cannot be achieved with The process of transmitting signals in the channel is always
SIMULINK), the system through the channel are assumed to be white disturbed by noise, and there is no noise when there is no transmission
2
signal in the communication system. Noise always exists in the end
communication system. Since such noise is superimposed on the signal, sfm = am * cos (2 * pi * fc * t + 2 * pi * kf * int_mt); %
it is sometimes referred to as additive noise. The noise is harmful to modulation, generating modulated signal
the transmission of the signal, which can distort the analog signal. In
the course of this simulation, we assume that the channel is a Gaussian Figure 3 FM modulation
white noise channel.
Modulation in the communication system has a very important 2.3 FM demodulation model is established
role. In one aspect, the spectrum of the baseband signal can be moved The demodulation of the modulation signal is divided into
to a desired position by modulation to convert the modulated signal coherent demodulation and non-coherent demodulation. Coherent
into a modulated signal suitable for channel transmission or for demodulation is only applicable to narrowband FM signals and there is
channel multiplexing. On the other hand, modulation can improve the need to synchronize the signal with limited scope of application.
signal through the channel when the anti-jamming capability. At the However, non-coherent demodulation does not require synchronization
same time, it is also related to transmission efficiency. To be specific, of signal and is applicable for the NBFM signal and WBFM signal.
the bandwidth of the modulated signal generated by the different Therefore, the FM system is the main demodulation method. In the
modulation schemes is different. Therefore, the modulation affects the simulation process, we choose to use non-coherent demodulation
utilization of the transmission bandwidth. It can be seen that the method for demodulation.
modulation method often determine the performance of a
communication system. In the simulation process, we choose to use Figure 4 FM demodulation model
FM modulation method for modulation.
The modulation process is a process of moving the spectrum by Non-coherent demodulator consists of limiter, frequency
moving the spectrum of the low frequency signal to the carrier discriminator and low-pass filter. The block diagram is shown in
frequency position while the demodulation is to move back the signal Figure 5. Limiter input is the FM signal and noise, the limiter is to
spectrum at the carrier frequency and to recover the original baseband eliminate the received signal in the amplitude may be the distortion
signal without distortion. In the simulation process, we choose to use then bandpass filter is used to limit the out-of-band noise as the allow
non-coherent demodulation method for demodulation. the FM signal to pass through successfully. The discriminator in the
frequency discriminator converts the FM signal into an amplitude
2.1 FM modulation model establishment modulated frequency modulated wave then detects the envelope by the
envelope detector and finally extracts the modulation signal through
Figure 2 FM modulation model the low pass filter.
Among them, m(t) referred as the baseband modulation signal,
set the modulation signal 2.4 Demodulation process analysis
Set the input FM signal as
Set the sine carrier for
The function of the differentiator is to convert the FM signal
The signal transmission channel is a Gaussian white noise into amplitude modulation and frequency modulation. The differential
channel, the power referred as . output is
2.2 Modulation process analysis The effect of envelope detection is to detect the modulation
In the modulation, the frequency of the modulation signal is to signal from the amplitude variation of the output signal. Envelope
control the carrier frequency changes. The carrier instantaneous detector output is
frequency offset with the modulation signal is proportional to the is called as the frequency sensitivity () which is the signal
change that is, amplitude of the modulated signal corresponding to the amplitude of
the modulation after passing the low-pass filter in addition to DC
In the formula, is the FM sensitivity (). capacitors, isolated the useless DC, can get
The phase offset is now
Differentiator achieved through the program, the code is as
You can get the FM signal follows:

Modulation signal generated by M file: For i = 1: length (t) -1 % Accept the signal through
dt = 0.001; % Set the time step the differentiator
t = 0: dt: 1.5; % Generates the time vector diff_nsfm (i) = (nsfm (i + 1) - nsfm (i)) ./ dt;
am = 15; % Set the modulation signal amplitude ← End
Can be changed diff_nsfmn = abs (hilbert (diff_nsfm)); % hilbert transform,
fm = 15; % Set the modulation signal frequency ← find the absolute value of
Can be changed the instantaneous amplitude (envelope
mt = am * cos (2 * pi * fm * t); % Generates the modulation detection)
signal Through the M file to draw out two different signals to noise
fc = 50; % Set carrier frequency ← Can be changed ratio demodulation output waveform is as follows:
ct = cos (2 * pi * fc * t); % Generates the carrier
kf = 10; % Set the FM index Figure 5 FM demodulation
int_mt (1) = 0; % Integrate mt
For i = 1: length (t) -1
int_mt (i + 1) = int_mt (i) + mt (i) * dt;
3
2.5 Gaussian white noise channel characteristics
Set the signal of sine wave through the additive white Gaussian In the large signal to noise ratio conditions, the signal and noise
noise channel as interaction can be ignored. Then, the signal and noise can be counted
separately. Here, we can get the demodulator output signal to noise
Among them, the probability distribution of the value of white ratio
noise n(t) obeys the Gaussian distribution.
MATLAB itself comes with the internal functions randn of the In the above equation, A is the amplitude of the carrier, is the
standard Gaussian distribution. The randn function produces a random frequency of the frequency modulator, the highest frequency of the
sequence that obeys the mean of and the variance of of the Gaussian modulation signal m(t) and is the noise unilateral power spectral
distribution. density.
The sine wave is passed through the additive Gaussian white If we consider m(t) as the case of a single frequency cosine
noise channel then signal referred as wave, we can get the system gain of the demodulator as

The useful signal power is When considering the broadband frequency modulation, the
bandwidth signal is
Noise power is
Then can get
SNR satisfies the formula
It can be seen that the signal-to-noise ratio gain of the
Then can get the formula broadband FM system is high when the signal-to-noise ratio is large
which is proportional to the cube of the FM index. It is abvious that
We can use this formula to set the variance of Gaussian white increase the FM index, the FM system can make the anti-noise
noise easily. performance improved rapidly.

In this simulation process, we choose two different signals of 3.Simulation implementation


10db and 30db to noise ratio to show the difference, the time domain
diagram shown in Figure 7 and Figure 8. Figure 10 Program flow chart
3.1 MATLAB source code
Figure 6 Time-domain diagram of modulated signals with no % FM modulation and demodulation system
noise % Frequency modulation and demodulation of the Matlab demo
source
Figure 7 Time-domain diagram of the modulated signal with % Can be arbitrarily changed to the original modulation signal
small SNR Gaussian white noise function m (t)
% Information Engineering Chen Li Dan 07323202
Figure 8 Time-domain diagram with a large signal-to-noise ratio %**************************
Gaussian white noise modulated signal %*****************initialization******************
Echo off
2.6 Modulation of anti-noise performance of FM system Close all
From the previous analysis we can see that the demodulation of Clear all
the FM signal has two types which are coherent demodulation and Clc
non-coherent demodulation. Coherent demodulation is only applicable % *****************************************
to narrowband FM signals and requires synchronization signals. Non- **************************
coherent demodulation is suitable for narrowband and wideband FM % **************** FM modulation *******************
signals without the need of synchronization signals. Since the primary dt = 0.001; % Set the time step
demodulation is the FM system, only non-coherent demodulation t = 0: dt: 1.5; % Generates the time vector
system anti-noise performance will be discussed here. The analysis am = 5; % Sets the modulation signal
model is shown in Figure 9. amplitude
fm = 5; % Get the modulation signal
Fig.9 Anti-noise performance analysis model of FM system frequency
The bandpass filter in the figure is used to suppress noise mt = am * cos (2 * pi * fm * t); % Generates the
outside the signal bandwidth. n(t) is the Gaussian white noise with modulation signal
zero mean and unilateral power spectral density. It will become a fc = 50; % Set the carrier frequency
narrow band Gaussian noise after passing bandpass filter. The limiter ct = cos (2 * pi * fc * t); % Generates the carrier
is intended to eliminate the distortions that may occur in the amplitude kf = 10; % Set the FM index
of the received signal. int_mt (1) = 0;
Set the FM signal to for i = 1: length (t) -1
int_mt (i + 1) = int_mt (i) + mt (i) * dt; % Integrate the
The input power is signal m (t)
End % Modulation, generating a
The input noise power is modulated signal
sfm = am * cos (2 * pi * fc * t + 2 * pi * kf * int_mt); %
So, the input signal to noise ratio is modulation signal
4
% ***************************************** n1 = 0;
************************** Else
% ************* add Gaussian white noise ************** n1 = fs / df;
sn1 = 10; % set the signal to noise ratio (small End
signal to noise ratio) n2 = length (sfm);
sn2 = 30; % set the signal to noise ratio (large n = 2 ^ (max (nextpow2 (n1), nextpow2 (n2)));
signal to noise ratio) U = fft (sfm, n);
sn = 0; % Set the signal to noise ratio (no signal u = [sfm, zeros (1, n-n2)];
to noise ratio) df1 = fs / n; % The above is the Fourier transform of
db = am ^ 2 / (2 * (10 ^ (sn / 10))); % Calculate the variance of the modulated signal u
the corresponding Gaussian white noise U = U / fs; % scaling
n = sqrt (db) * randn (size (t)); % Generates Gaussian noise % ******************************************
nsfm = n + sfm; % Generates a modulated signal % *****************************************
containing Gaussian %**************************
noise % Over channel transmission) % *************** Show the program ******************
% ***************************************** disp ('press any key to see the original modulation signal, carrier
************************** signal and modulated signal curve')
% **************** FM demodulation pause
******************* % ************** figure (1) ******************
For i = 1: length (t) -1 % The accept signal is figure (1)
processed by the differentiator subplot (3,1,1); plot (t, mt); % Draw the time domain of the
diff_nsfm (i) = (nsfm (i + 1) - nsfm (i)) ./ dt; modulated signal
End xlabel ('time t');
diff_nsfmn = abs (hilbert (diff_nsfm)); % hilbert transform, title ('time domain map of modulation signal');
find the absolute value of the instantaneous amplitude (envelope subplot (3,1,2); plot (t, ct); % plot the time domain of the
detection) carrier
zero = (max (diff_nsfmn) -min (diff_nsfmn)) / 2; xlabel ('time t');
diff_nsfmn1 = diff_nsfmn-zero; title ('Carrier Time Domain Graph');
% ***************************************** subplot (3,1,3);
************************** plot (t, sfm); % Draws the time domain graph of
% ************** Time domain to frequency domain the modulated signal
conversion ************** xlabel ('time t');
ts = 0.001; % Sampling interval title ('time domain map of modulated signal');
fs = 1 / ts; % Sampling frequency % ******************************************
df = 0.25; % The desired frequency resolution is used disp ('press any key to see the original modulation signal and
in the Fourier transform the modulated signal in the frequency domain within the graphics')
%, It represents the minimum frequency interval of the FFT pause
% ***** Find the Fourier transform of the modulation signal m % ************ figure (2) *********************
(t)***** figure (2)
m = am * cos (2 * pi * fm * t); % original tone signal subplot (2,1,1)
fs = 1 / ts; plot (F, abs (fftshift (M))) % fftshift: Moves the DC
if nargin == 2 component in the FFT to the
n1 = 0; center of the spectrum
Else xlabel ('frequency f')
n1 = fs / df; title ('Spectrum of Original Modulation Signal')
End subplot (2,1,2)
n2 = length (m); plot (f, abs (fftshift (U)))
n = 2 ^ (max (nextpow2 (n1), nextpow2 (n2))); xlabel ('frequency f')
m = fft (m, n); title ('Spectrum of modulated signal')
m = [m, zeros (1, n-n2)]; % ******************************************
df1 = fs / n; % The above procedure is to find the disp ('press any key to see the original modulation signal, no
Fourier transform of noise conditions, the signal has been modulated and demodulated
the modulated signal u signal curve')
M = M / fs; % scale, easy to observe the overall pause
image in the frequency shop % ************** figure (3) ******************
f = [0: df1: df1 * (length (m) -1)] - fs / 2;% time vector figure (3)
corresponding to the frequency vector subplot (3,1,1); plot (t, mt); % Draw the time domain of
the modulated signal
% ************ on the adjusted signal u seeking Fourier xlabel ('time t');
transform ********** title ('time domain map of modulation signal');
fs = 1 / ts; subplot (3,1,2); plot (t, sfm); % Draw the time domain
if nargin == 2 graph of the modulated signal
5
xlabel ('time t'); ('Time domain map with small signal - to - noise ratio Gaussian
title ('time - domain diagram of modulated signal without noise'); white noise demodulation signal');
nsfm = sfm; % *****************************************
For i = 1: length (t) -1 % The accept signal is disp ('press any key to see the original modulation signal, large
processed by the differentiator signal to noise ratio Gaussian white noise conditions have been
diff_nsfm (i) = (nsfm (i + 1) - nsfm (i)) ./ dt; modulated signal and demodulated signal has been modulated signal
End curve')
Diff_nsfmn = abs (hilbert (diff_nsfm)); % hilbert transform, Pause
find the absolute value of the instantaneous amplitude (envelope % ************** figure (5) ******************
detection) figure (5)
zero = (max (diff_nsfmn) -min (diff_nsfmn)) / 2; subplot (3,1,1); plot (t, mt); % Draw the time domain
diff_nsfmn1 = diff_nsfmn-zero; of the modulated signal
subplot (3,1,3); % Draws the time domain diagram xlabel ('time t');
of the demodulated title ('time domain map of modulation signal');
signal under noisy conditions db1=am^2/(2*(10 ^ (sn2 / 10))); % Calculate the
plot ((1: length (diff_nsfmn1)) ./ 1000, diff_nsfmn1. / 400, 'r'); variance of the corresponding
xlabel ('time t'); large signal-to-noise ratio Gaussian
title ('time - domain diagram of demodulated signal without white noise
noise'); n1 = sqrt (db1) * randn (size (t)); % Generate Gaussian
% ***************************************** white noise
disp ('press any key to see the original modulation signal, small nsfm1 = n1 + sfm; % Generates modulated signals
signal to noise ratio Gaussian white noise conditions have been containing Gaussian
modulated signal and demodulated signal has been modulated signal noise (signal through channel
curve') transmission)
pause For i = 1: length (t) -1 % The accept signal is
% ************** figure (4) ****************** processed by the differentiator
figure (4) diff_nsfm1 (i) = (nsfm1 (i + 1) - nsfm1 (i)) ./ dt;
subplot (3,1,1); plot (t, mt); % Draw the time domain End
of the modulated signal diff_nsfmn1 = abs (hilbert (diff_nsfm1)); % hilbert transform,
xlabel ('time t'); find the absolute value of the
title ('time domain map of modulation signal'); instantaneous amplitude (package %
db1 = am ^ 2 / (2 * (10 ^ (sn1 / 10))); % Calculate the detection)
variance of the corresponding small zero = (max (diff_nsfmn) -min (diff_nsfmn)) / 2;
signal-to-noise ratio Gaussian white diff_nsfmn1 = diff_nsfmn1-zero;
noise subplot (3,1,2);
n1 = sqrt (db1) * randn (size (t)); % Generate Gaussian plot (1: length (diff_nsfm1), diff_nsfm1); % is plotted with
white noise large signal-to-noise ratio Gaussian
nsfm1 = n1 + sfm; % Generates modulated signals white noise % of the time domain map
containing Gaussian xlabel ('time t');
noise (% Over channel transmission) title ('Time - domain map with large signal-to-noise ratio
For i = 1: length (t) -1 % The accept signal is Gaussian white noise modulated signal');
processed by the differentiator subplot (3,1,3); % draw with high SNR Gaussian
diff_nsfm1 (i) = (nsfm1 (i + 1) - nsfm1 (i)) ./ dt; white noise
End demodulation signal % of the time
diff_nsfmn1 = abs (hilbert (diff_nsfm1)); % hilbert transform, domain map
find the absolute value of the plot ((1: length (diff_nsfmn1)) ./ 1000, diff_nsfmn1. / 400, 'r');
instantaneous amplitude (envelope xlabel ('time t');
detection) title ('Time - domain map with large signal-to-noise ratio
zero = (max (diff_nsfmn) -min (diff_nsfmn)) / 2; Gaussian white noise demodulation signal');
diff_nsfmn1 = diff_nsfmn1-zero; % *****************************************
subplot (3,1,2); %******************End*******************
plot (1: length (diff_nsfm), diff_nsfm); % plot the time-
domain map with small signal-to-noise 3.2 Simulation results
ratio Gaussian white noise
xlabel ('time t');
title ('Time - domain diagram with small signal -to-noise ratio In conclusion
Gaussian white noise modulated signal'); Through the simulation of mobile communication system, the
subplot (3,1,3); % Draw a time domain diagram working principle of OFDM system and the interference in the
with a small SNR transmission process are simulated and analyzed. The basic working
Gaussian white noise demodulation signal principle of OFDM system is clarified, which lays the foundation for
plot ((1: length (diff_nsfmn1)) ./ 1000, diff_nsfmn1. / 400, 'r'); improving the efficiency of mobile communication and further
xlabel ('time t'); reducing the signal interference.
6
OFDM system is suitable for multi-service, highly flexible
communication system, the spectrum utilization is high, and the
system stability is good. At present, OFDM has been widely used in
Europe and Australia, digital broadband audio systems and digital
broadband video systems, OFDM-based communication technology,
enabling the transmission process to achieve low latency, high-speed
data transmission. 54Mbit/s bandwidth is basically able to meet the
majority of users on the wireless network requirements. With the
continuous improvement of OFDM technology, its application will be
extended to various fields.
For the fourth generation of mobile communication standards,
OFDM still has many problems to be solved, select OFDM as the
fourth generation of mobile communication core technology, the main
reasons include high spectral efficiency, anti-noise ability, suitable for
high-speed data transmission factor.

Experience

This graduation design is an important part of cultivating our students'


comprehensive use of the knowledge, discovering, proposing, analyzing and
solving practical problems and exercising practical ability. It is a concrete
training and investigation process for the practical ability of our students.
Looking back on the communication circuit design, from the topic to the
finalization, from theory to practice, in a whole week of the day, I there is more
bitter than sweet. However, I have learnt a lot of the things. I have learnt how to
consolidate the previously learned theoretical knowledge and expanded my
practical knowledge that was no written in the books. This graduation design
makes me understand that the combination of theory and practice is very
important; only the theoretical knowledge is far from enough. The only way is
to learn how to combine the theoretical knowledge and practice together. The
only method to provide better social service, we have to draw conclusions from
the theory as to improve their practical ability and independent thinking ability.
I have encountered many problems while studying this design, since this is the
first time to carry out this study. Besides, I have also realized my shortcomings
while carrying this design process. The knowledge which I have learnt was not
thorough enough and I have not mastered them. After this graduation design, I
must revise all the knowledge I have learnt in the past. The curriculum design
has finally completed, I have encountered a lot of problems and all finally
solved under the assistance of teachers and friends. I would like to thank all of
them sincerely.

REFERENCES

[1] Fan Changxin, et al. Communication Principles (Sixth Edition). Beijing:


National Defense Industry Press.
[2] Luo Junhu, et al. MATLAB7.0 in the application of digital signal processing.
Beijing: Mechanical Industry Press.
[3] Liu Weiguo, et al. MATLAB programming tutorial. Beijing: China Water
Resources and Hydropower Press.Press .2004

You might also like