SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                                 1


                Colorado Technical University
                 EE 443 – Communication 1
   Lab 2: MATLAB Project – Frequency Modulation / Detection
                          and Noise
                      September 2010
                                                   Loren K. Schwappach

          ABSTRACT: This lab report was completed as a course requirement to obtain full course credit in EE443,
Communication 1 at Colorado Technical University. Given a message and a carrier signal, this lab report uses MATLAB to
demonstrate the process of frequency modulation and demodulation of the message using a VCO. All of the code mentioned
in this lab report was saved as a MATLAB m-file for convenience, quick reproduction, and troubleshooting of the code. All of
the code below can also be found at the end of the report as an attachment, as well as all figures. All of the code and images
created for this report are authentic and of my sole content. Since I finished 90 percent of this lab ahead of my struggling peers
I shared snippets of my code with a few students (Shawn Malone, and Crystal Brandy) to aid in their understanding of the this
lab and assisted them in working through Simulink although they will need to provide their own lab reports with their own
content.
          If you have any questions or concerns in regards to this laboratory assignment, this laboratory report, the process
used in designing the indicated circuitry, or the final conclusions and recommendations derived, please send an email to
LSchwappach@yahoo.com. All computer drawn figures and pictures used in this report are of original and authentic content.

                                                                             Finally Simulink is used to show what happens to a
                     I. INTRODUCTION                               sinusoidal signal after noise is added, and then removed via a
         The purpose of this lab is to learn how to                low pass filter, next the signal is replaced with a square wave
characterize a Frequency modulated (FM) signal                     input, finally the signal is passed though a slope detector and
mathematically and simulate the frequency modulation of an         analyzed.
input signal using MATLABs Simulink software. This lab also
serves as an introduction into the effects of noise on a system
and how to plot noise in MATLAB.                                                   III. PROCEDURE / RESULTS

                                                                            The procedures used in this lab are illustrated by the
                      II. OBJECTIVES                               included MATLAB code and Simulink diagrams in this report.
          There are three tasks that need to be completed for
                                                                                 1.   Part 1 – FM Modulation in MATLAB
this lab assignment.
                                                                            To begin this lab a time vector ‘t’ is created as well as
        The first task is to frequency modulate a signal in        the corresponding message and carrier signal components as
MATLAB and plot the FM signal in the time and frequency            shown bellow...
domain, and then select values of Beta which can simulate
narrow band (NB) FM, wideband (WB) FM, and an FM signal            % Generating Carrier, Message and Modulated wave
                                                                   Fc = 500;
without a carrier (dropped carrier scenario).                      Ac = 2;
                                                                   Pc = 0;
                                                                   Fm = 25;
          The second task is to frequency modulate a signal        Am = 1;
using a Voltage-Controlled Oscillator (VCO) in Simulink and        Pm = 0;
then use a transfer function to simulate a slope detector          Beta = 0;
                                                                   fs = 5000; %sampling frequency
circuit such that the slope detector output is a combination of    ts = 1/fs; %sampling interval
FM and AM.                                                         t = 0:ts:((1/Fm)*3); %time vector


         The third and final tasks involves noise. First a noise           Next the components were put together to display
signal is generated and graphed in MATLAB, next the                our message wave and carrier wave as shown below..
autocorrelation function of the noise signal is created.
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                      2

m = Am*sin(2*pi*Fm*t + Pm); %message wave
c = Ac*sin(2*pi*Fc*t + Pc); %carrier wave

        The final FM modulated signal is of the form..
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM
signal

         This frequency modulated signal was then plot in the
time domain and in the frequency domain using various
values of Beta needed to demonstrate NB, WB, and carrier
missing FM as shown.

% ------- B = .1
Beta = .1;
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM
signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and
keeps it available
plot (t,st); %plots FM signal in time domain
title('FM Signal (B=.1) - Time domain'); %adds title
to graph                                                        Figure 2: FM Signal Beta = .1 in the frequency domain.
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
                                                                Notice there are very few sideband frequencies making up
grid; %turns on grid                                            the message signal thus the low bandwidth (Narrowband)
axis([0,40e-3,-2,2]); %defines axis
[x(min),x(max),y(min),y(max)]                                   % Plot of Modulated Wave in Frequency Domain - Close
                                                                Up
                                                                freqPlot = figure; %gives graph window a name and
                                                                keeps it available
                                                                stem(SfRange,Sf); %Creates stem graph for magnitude
                                                                spectrum
                                                                title('FM Signal (B=.1) - Pos Spectrum Closeup')
                                                                xlabel('Freq (Hz)'); %adds xlabel to graph
                                                                ylabel('Amplitude'); %adds ylabel to graph
                                                                grid; %turns on grid
                                                                axis([400,600,-.1,.4]); %defines axis
                                                                [x(min),x(max),y(min),y(max)]




Figure 1: FM Signal, Beta = .1 in the time domain.

% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT
function
freqPlot = figure; %gives graph window a name and
keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude
spectrum
title('FM Signal (B=.1) - 2 Sided Spectrum') %adds
title to graph                                                  Figure 3: FM Signal Beta = .1 in the frequency domain
xlabel('Freq (Hz)'); %adds xlabel to graph                      (Close-up). Notice there are very few sideband frequencies
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
                                                                making up the message signal thus the low bandwidth
axis([-800,800,-.1,.4]); %defines axis                          (Narrowband)
[x(min),x(max),y(min),y(max)]
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                3

% ------- B = 5
Beta = 5;
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM
signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and
keeps it available
plot (t,st); %plots FM signal in time domain
title('FM Signal (B=5) - Time domain'); %adds title
to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,40e-3,-2,2]); %defines axis
[x(min),x(max),y(min),y(max)]




                                                         Figure 5: FM Signal Beta = 5 in the frequency domain.
                                                         Notice there are many sideband frequencies making up the
                                                         message signal thus the higher bandwidth (Wideband)
                                                         % Plot of Modulated Wave in Frequency Domain - Close
                                                         Up
                                                         freqPlot = figure; %gives graph window a name and
                                                         keeps it available
                                                         stem(SfRange,Sf); %Creates stem graph for magnitude
                                                         spectrum
                                                         title('FM Signal (B=5) - Pos Spectrum Closeup')
                                                         xlabel('Freq (Hz)'); %adds xlabel to graph
                                                         ylabel('Amplitude'); %adds ylabel to graph
                                                         grid; %turns on grid
                                                         axis([200,800,-.1,.4]); %defines axis
                                                         [x(min),x(max),y(min),y(max)]
Figure 4: FM Signal, Beta = 5 in the time domain.
% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT
function
freqPlot = figure; %gives graph window a name and
keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude
spectrum
title('FM Signal (B=5) - 2 Sided Spectrum') %adds
title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([-1000,1000,-.1,.4]); %defines axis
[x(min),x(max),y(min),y(max)]




                                                         Figure 6: FM Signal Beta = 5 in the frequency domain
                                                         (close-up). Notice there are many sideband frequencies
                                                         making up the message signal thus the higher bandwidth
                                                         (Wideband)
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                    4

% ------- FM Signal with No Carrier
Beta = 1;
Ac = 0; %Carrier is no longer transmitting
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM
signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and
keeps it available
plot (t,st); %plots FM signal in time domain
title('FM Signal (No carrier) - Time domain'); %adds
title to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,40e-3,-2,2]); %defines axis
[x(min),x(max),y(min),y(max)]




                                                          Figure 8: FM Signal without a carrier in the frequency
                                                          domain. No signals present because no carrier!
                                                          % Plot of Modulated Wave in Frequency Domain - Close
                                                          Up
                                                          freqPlot = figure; %gives graph window a name and
                                                          keeps it available
                                                          stem(SfRange,Sf); %Creates stem graph for magnitude
                                                          spectrum
                                                          title('FM Signal (No carrier) - Pos Spectrum
                                                          Closeup')
                                                          xlabel('Freq (Hz)'); %adds xlabel to graph
                                                          ylabel('Amplitude'); %adds ylabel to graph
                                                          grid; %turns on grid
                                                          axis([0,1000,-.1,.4]); %defines axis
                                                          [x(min),x(max),y(min),y(max)]
Figure 7: FM Signal with no carrier (Ac = 0). Without a
carrier you have no FM!
% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT
function
freqPlot = figure; %gives graph window a name and
keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude
spectrum
title('FM Signal (No carrier) - 2 Sided Spectrum')
%adds title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([-1000,1000,-.1,.4]); %defines axis
[x(min),x(max),y(min),y(max)]




                                                          Figure 9: FM Signal without a carrier in the frequency
                                                          domain (close-up). No signals present because no carrier!
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise               5

            2.   Part 2 – FM Modulation and Partial
                 Demodulation in MATLAB

         For the next phase of the lab a new square wave
message signal is now generated in MATLAB using a VCO in
Simulink. The message frequency and carrier were chosen in
such a way as to be easily visible by the scope. The
modulation and settings used in Simulink are illustrated by
the figures below.




Figure 10: Simulink Block Diagram for FM Modulation



                                                              Figure 11: Simulink Pulse generator settings for
                                                              generating a 100Hz square wave.
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise              6




                                                           Figure 14: The output frequency modulated wave.


Figure 12: VCO settings for Modulating the input signal.
The quiescent frequency is the fc in FM and the Input
sensitivity is the kf in FM. Thus this should adequately
frequency modulate our message onto a 1k Hertz carrier
with a high enough Kf to produce around two to four
sidebands (wideband).




                                                           Figure 15: The message square wave in the time domain.
                                                           Notice a square wave has many low frequency components
                                                           (> 0dB.)




Figure 13: The output square wave in the time domain.
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                          7




                                                               Figure 18: As a result of positive slope detection we
Figure 16: The FM wave in the frequency domain. Notice
                                                               receive an FM-AM product. Using a good envelope
there are about four sidebands >0dB representing our FM
                                                               detector we could then attempt to demodulate our signal.
wave.
                                                               However a good envelope detector is a complex process
                                                               and requires several block sets in MATLAB. Another
         Now that we have produced a good modulated wave
                                                               approach is to use a phase-locked loop which was
the next step is demodulation of the FM wave. The lab          demonstrated in another class project.
wished to demonstrate demodulation using a positive and
negative slope detector simulated as transfer functions.
However the next step following slope detection is envelope
detection and an envelope detection module is not common
to the Simulink library so this step could not be completed.
Another approach to demodulation involved a phase-locked
loop system, an easier process to manage in Simulink.




                                                               Figure 19: The AM-FM wave in the frequency spectrum.

                                                                            3.   Part 2 – Noise
Figure 17: Partial Demodulation of FM wave using a
positive slope detector circuit in Simulink.                            The next and final phase of the lab involved creating
                                                               and plotting a noise signal in MATLAB in the time and
                                                               frequency domain, as well as the autocorrelation function of
                                                               that noise. This accomplished with the following code...

                                                               % Noise signal
                                                               fs = 10000; %sampling frequency
                                                               ts = 1/fs; %sampling interval
                                                               t = 0:ts:1-ts; %time vector
                                                               nt = rand([1,10000]); % returns an n-by-n matrix
                                                               containing pseudorandom values
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                        8


% Plot of noise signal in Time Domain
timePlot = figure; %gives graph window a name and
keeps it available
plot (t,nt); %plots noise in time domain
title('Noise Signal - Time Domain'); %adds title to
graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid




                                                         Figure 21: Noise signal in the frequency domain. Notice
                                                         noise is very small (almost 0) at higher frequencies but an
                                                         impulse at 0 Hz. This is as expected, which is why a small
                                                         resistor can do wonders at eliminating LF noise!

                                                                 Now the autocorrelation function was found using the
                                                         following code...

                                                         % Plot of autocorrelation of n(t)
Figure 20: Noise signal in the time domain.              Rxx=xcorr(nt); % Estimate its autocorrelation
                                                         ACorrPlot = figure;
% Plot of noise signal in Frequency Domain               plot(Rxx); % Plot the autocorrelation
[Nf,NfRange] = centeredFFT(nt,fs); %Uses centeredFFT     title('Autocorrelation Function of n(t)');
function                                                 xlabel('time shift - lags');
freqPlot = figure; %gives graph window a name and        ylabel('Autocorrelation');
keeps it available                                       grid; %turns on grid
stem(NfRange,Nf); %Creates stem graph for magnitude
spectrum
title('Noise Signal - 2 Sided Spectrum') %adds title
to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid




                                                         Figure 22: Autocorrelation function of noise signal.

                                                                  Finally Simulink was used to insert noise into a
                                                         sinusoidal message signal, a low pass filter was used to
                                                         eliminate the noise (while varying the noise). Lastly a square
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                         9

wave message was used and the output was again sent to the
slope detector circuit for analysis. The results follow..




                                                             Figure 25: Message signal with large Gaussian noise after
                                                             LP filter, notice you can now kind of see the message.




Figure 23: Simulink circuit used for noise simulations.




                                                             Figure 26: Message signal with smaller amount of
                                                             Gaussian noise after a LP filter stage. Notice the noise is
                                                             much less now.




Figure 24: This is a representation of the message signal
with large added Gaussian noise.
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise              10




                                                         Figure 29: After LP filtering out the noise, where is our
                                                         signal? This is because a square wave contains many high
                                                         frequency components that just got filtered out!




Figure 27: Simulink block diagram used for Pulse
generator (square wave input).




                                                         Figure 30: Results of LP filtering our square wave with
                                                         less noise added to the signal. Now we are getting
                                                         somewhere, however we’ve still lost the form of our square
                                                         wave.
Figure 28: Large amount of noise added to square wave.
If you can still call it that.
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise                   11


                                                                             IV. CONCLUSIONS

                                                                   The frequency modulation (FM) process was easy to
                                                         simulate using MATLAB code. Beta’s influence in the
                                                         bandwidth of an FM signal was further reinforced, as well as
                                                         the concept of what drives frequency modulation (the
                                                         carrier). Without a carrier there is nothing to modulate thus
                                                         no FM signal.

                                                                  The Simulink modeling of an FM wave further
                                                         improved my understanding and demonstrated that a slope
                                                         detector can be used to create an FM-AM hybrid wave that’s
                                                         AM potion can be envelope detected to retrieve a message
                                                         signal.

                                                                 Graphing noise in MATLAB was a breeze and quite
                                                         informative. By simulating the noise in Simulink a greater
                                                         understanding of the drastic effects of noise on signals and
                                                         the important use of specially designed filters. It was finally
                                                         observed that noise plays an even greater role on digital
                                                         systems such as a square wave which contains several
                                                         frequency components. Isolating noise from such a system is
                                                         even more difficult due to the increased number of frequency
                                                         components (harmonics) making up the message.

                                                                 This was a satisfying lab and if I had further time I
                                                         would have enjoyed fully demodulating the FM wave using an
Figure 31: Simulink block diagram used for simulating    additional negative slope detector and two envelope
noise entering an FM modulation scheme.                  detectors.


                                                                                 REFERENCES
                                                                                                                      nd
                                                         [1] Haykin, S., “Analog and Digital Communications 2
                                                             Edition” John Wiley & Sons, Haboken, NJ, 2007.




Figure 32: FM Scheme with added large noise. No longer
looks anything like FM!
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise   12

function Lab3 = Comm1Lab3() %Function name for calling in MATLAB
% Colorado Technical University
% EE 443 - Communications I
% Lab 3 - MATLAB Project - Frequency Modulation/ Demodulation and Noise
% By Loren K. Schwappach
% Uses centeredFFT() for obtaining a two-sided spectrum

% ---------------------------
% ------- TASK 1
% Generating Carrier, Message and Modulated wave
Fc = 500;
Ac = 2;
Pc = 0;
Fm = 25;
Am = 1;
Pm = 0;
Beta = 0;
fs = 5000; %sampling frequency
ts = 1/fs; %sampling interval
t = 0:ts:((1/Fm)*3); %time vector
m = Am*sin(2*pi*Fm*t + Pm); %message wave
c = Ac*sin(2*pi*Fc*t + Pc); %carrier wave
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal

% ------- B = .1
Beta = .1;
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and keeps it available
plot (t,st); %plots FM signal in time domain
title('FM Signal (B=.1) - Time domain'); %adds title to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (B=.1) - 2 Sided Spectrum') %adds title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([-800,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of Modulated Wave in Frequency Domain - Close Up
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (B=.1) - Pos Spectrum Closeup')
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([400,600,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% ------- B = 5
Beta = 5;
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and keeps it available
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise   13

plot (t,st); %plots FM signal in time domain
title('FM Signal (B=5) - Time domain'); %adds title to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (B=5) - 2 Sided Spectrum') %adds title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of Modulated Wave in Frequency Domain - Close Up
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (B=5) - Pos Spectrum Closeup')
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([200,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% ------- FM Signal with No Carrier
Beta = 1;
Ac = 0; %Carrier is no longer transmitting
st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal
% Plot of FM signal in Time Domain
timePlot = figure; %gives graph window a name and keeps it available
plot (t,st); %plots FM signal in time domain
title('FM Signal (No carrier) - Time domain'); %adds title to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of FM Signal in Frequency Domain
[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (No carrier) - 2 Sided Spectrum') %adds title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% Plot of Modulated Wave in Frequency Domain - Close Up
freqPlot = figure; %gives graph window a name and keeps it available
stem(SfRange,Sf); %Creates stem graph for magnitude spectrum
title('FM Signal (No carrier) - Pos Spectrum Closeup')
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid
axis([0,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]

% ------- End of Task 1
CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise   14

% ---------------------------------------------

% ------- Task 2 is done with Simulink

% ---------------------------------------------
% ------- TASK 3
% Noise signal
fs = 10000; %sampling frequency
ts = 1/fs; %sampling interval
t = 0:ts:1-ts; %time vector
nt = rand([1,10000]); % returns an n-by-n matrix containing pseudorandom values

% Plot of noise signal in Time Domain
timePlot = figure; %gives graph window a name and keeps it available
plot (t,nt); %plots noise in time domain
title('Noise Signal - Time Domain'); %adds title to graph
xlabel('Time (s)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid

% Plot of noise signal in Frequency Domain
[Nf,NfRange] = centeredFFT(nt,fs); %Uses centeredFFT function
freqPlot = figure; %gives graph window a name and keeps it available
stem(NfRange,Nf); %Creates stem graph for magnitude spectrum
title('Noise Signal - 2 Sided Spectrum') %adds title to graph
xlabel('Freq (Hz)'); %adds xlabel to graph
ylabel('Amplitude'); %adds ylabel to graph
grid; %turns on grid

% Plot of autocorrelation of n(t)
Rxx=xcorr(nt); % Estimate its autocorrelation
ACorrPlot = figure;
plot(Rxx); % Plot the autocorrelation
title('Autocorrelation Function of n(t)');
xlabel('time shift - lags');
ylabel('Autocorrelation');
grid; %turns on grid

% ------- End of Task 3 MATLAB code portion
% ---------------------------------------------

% end Comm1Lab3

Contenu connexe

Tendances

Ncc2004 ofdm tutorial part i-rvr
Ncc2004 ofdm tutorial   part i-rvrNcc2004 ofdm tutorial   part i-rvr
Ncc2004 ofdm tutorial part i-rvrArpan Pal
 
Performance and Analysis of OFDM Signal Using Matlab Simulink
Performance and Analysis of OFDM Signal Using Matlab  SimulinkPerformance and Analysis of OFDM Signal Using Matlab  Simulink
Performance and Analysis of OFDM Signal Using Matlab SimulinkIJMER
 
Mathematical description of ofdm
Mathematical description of ofdmMathematical description of ofdm
Mathematical description of ofdmJulia Urbina-Pineda
 
Final presentation
Final presentationFinal presentation
Final presentationRohan Lad
 
Ofdm tutorial fuyun_ling_rev1
Ofdm tutorial fuyun_ling_rev1Ofdm tutorial fuyun_ling_rev1
Ofdm tutorial fuyun_ling_rev1Fuyun Ling
 
Signal and image processing on satellite communication using MATLAB
Signal and image processing on satellite communication using MATLABSignal and image processing on satellite communication using MATLAB
Signal and image processing on satellite communication using MATLABEmbedded Plus Trichy
 
CourseworkRadioComAssignDataBank
CourseworkRadioComAssignDataBankCourseworkRadioComAssignDataBank
CourseworkRadioComAssignDataBankCharan Litchfield
 
OFDM transmission step-by-step
OFDM transmission step-by-stepOFDM transmission step-by-step
OFDM transmission step-by-stepErwin Riederer
 
Sampling and Reconstruction of Signal using Aliasing
Sampling and Reconstruction of Signal using AliasingSampling and Reconstruction of Signal using Aliasing
Sampling and Reconstruction of Signal using Aliasingj naga sai
 
Baseband transmission
Baseband transmissionBaseband transmission
Baseband transmissionPunk Pankaj
 

Tendances (20)

Ncc2004 ofdm tutorial part i-rvr
Ncc2004 ofdm tutorial   part i-rvrNcc2004 ofdm tutorial   part i-rvr
Ncc2004 ofdm tutorial part i-rvr
 
Performance and Analysis of OFDM Signal Using Matlab Simulink
Performance and Analysis of OFDM Signal Using Matlab  SimulinkPerformance and Analysis of OFDM Signal Using Matlab  Simulink
Performance and Analysis of OFDM Signal Using Matlab Simulink
 
Mathematical description of ofdm
Mathematical description of ofdmMathematical description of ofdm
Mathematical description of ofdm
 
Final presentation
Final presentationFinal presentation
Final presentation
 
Final ppt
Final pptFinal ppt
Final ppt
 
Tham khao ofdm tutorial
Tham khao ofdm tutorialTham khao ofdm tutorial
Tham khao ofdm tutorial
 
Ofdm tutorial fuyun_ling_rev1
Ofdm tutorial fuyun_ling_rev1Ofdm tutorial fuyun_ling_rev1
Ofdm tutorial fuyun_ling_rev1
 
Channel estimation
Channel estimationChannel estimation
Channel estimation
 
Signal and image processing on satellite communication using MATLAB
Signal and image processing on satellite communication using MATLABSignal and image processing on satellite communication using MATLAB
Signal and image processing on satellite communication using MATLAB
 
Sistec ppt
Sistec pptSistec ppt
Sistec ppt
 
Ofdma Basics
Ofdma BasicsOfdma Basics
Ofdma Basics
 
CourseworkRadioComAssignDataBank
CourseworkRadioComAssignDataBankCourseworkRadioComAssignDataBank
CourseworkRadioComAssignDataBank
 
OFDM
OFDMOFDM
OFDM
 
OFDM transmission step-by-step
OFDM transmission step-by-stepOFDM transmission step-by-step
OFDM transmission step-by-step
 
Gu2512391243
Gu2512391243Gu2512391243
Gu2512391243
 
(Ofdm)
(Ofdm)(Ofdm)
(Ofdm)
 
Vblast
VblastVblast
Vblast
 
Tdm fdm
Tdm fdmTdm fdm
Tdm fdm
 
Sampling and Reconstruction of Signal using Aliasing
Sampling and Reconstruction of Signal using AliasingSampling and Reconstruction of Signal using Aliasing
Sampling and Reconstruction of Signal using Aliasing
 
Baseband transmission
Baseband transmissionBaseband transmission
Baseband transmission
 

En vedette

15.04.146 jurnal eproc
15.04.146 jurnal eproc15.04.146 jurnal eproc
15.04.146 jurnal eproceko dnero
 
Digital Implementation of Costas Loop with Carrier Recovery
Digital Implementation of Costas Loop with Carrier RecoveryDigital Implementation of Costas Loop with Carrier Recovery
Digital Implementation of Costas Loop with Carrier RecoveryIJERD Editor
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Akshay Sharma
 
MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)Analog Devices, Inc.
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tueVin Voro
 

En vedette (8)

Final Report
Final ReportFinal Report
Final Report
 
15.04.146 jurnal eproc
15.04.146 jurnal eproc15.04.146 jurnal eproc
15.04.146 jurnal eproc
 
Digital Implementation of Costas Loop with Carrier Recovery
Digital Implementation of Costas Loop with Carrier RecoveryDigital Implementation of Costas Loop with Carrier Recovery
Digital Implementation of Costas Loop with Carrier Recovery
 
DSB-SC Demodulation using matlab
DSB-SC Demodulation using matlabDSB-SC Demodulation using matlab
DSB-SC Demodulation using matlab
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
 
Pancreas function
Pancreas functionPancreas function
Pancreas function
 
MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tue
 

Similaire à CTU: EE 443 Lab 3 - MATLAB FM Modulation, Detection & Noise

EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf Loren Schwappach
 
Conitunous Time Modulation.pdf
Conitunous Time Modulation.pdfConitunous Time Modulation.pdf
Conitunous Time Modulation.pdfMHApu1
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulationAkanksha_Seth
 
Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292lucky859450
 
EBDSS Max Research Report - Final
EBDSS  Max  Research Report - FinalEBDSS  Max  Research Report - Final
EBDSS Max Research Report - FinalMax Robertson
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABMartin Wachiye Wafula
 
Matlab 2
Matlab 2Matlab 2
Matlab 2asguna
 
Ee463 communications 2 - lab 1 - loren schwappach
Ee463   communications 2 - lab 1 - loren schwappachEe463   communications 2 - lab 1 - loren schwappach
Ee463 communications 2 - lab 1 - loren schwappachLoren Schwappach
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulationZunAib Ali
 
Ec8395 ce by www.learn engineering.in
Ec8395 ce by www.learn engineering.inEc8395 ce by www.learn engineering.in
Ec8395 ce by www.learn engineering.inKarpoora Sundari
 
Sound analysis and processing with MATLAB
Sound analysis and processing with MATLABSound analysis and processing with MATLAB
Sound analysis and processing with MATLABTan Hoang Luu
 
Ee443 communications 1 - lab 2 - loren schwappach
Ee443   communications 1 - lab 2 - loren schwappachEe443   communications 1 - lab 2 - loren schwappach
Ee443 communications 1 - lab 2 - loren schwappachLoren Schwappach
 
The method of comparing two audio files
The method of comparing two audio filesThe method of comparing two audio files
The method of comparing two audio filesMinh Anh Nguyen
 

Similaire à CTU: EE 443 Lab 3 - MATLAB FM Modulation, Detection & Noise (20)

EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
 
Stft vs. mfcc
Stft vs. mfccStft vs. mfcc
Stft vs. mfcc
 
Conitunous Time Modulation.pdf
Conitunous Time Modulation.pdfConitunous Time Modulation.pdf
Conitunous Time Modulation.pdf
 
Signal Processing Assignment Help
Signal Processing Assignment HelpSignal Processing Assignment Help
Signal Processing Assignment Help
 
Digital Signal Processing Course Help
Digital Signal Processing Course HelpDigital Signal Processing Course Help
Digital Signal Processing Course Help
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulation
 
Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292
 
EBDSS Max Research Report - Final
EBDSS  Max  Research Report - FinalEBDSS  Max  Research Report - Final
EBDSS Max Research Report - Final
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
 
Generating PM wave
Generating PM wave Generating PM wave
Generating PM wave
 
Matlab 2
Matlab 2Matlab 2
Matlab 2
 
Es25893896
Es25893896Es25893896
Es25893896
 
Lab manual
Lab manualLab manual
Lab manual
 
Ee463 communications 2 - lab 1 - loren schwappach
Ee463   communications 2 - lab 1 - loren schwappachEe463   communications 2 - lab 1 - loren schwappach
Ee463 communications 2 - lab 1 - loren schwappach
 
dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulation
 
Ec8395 ce by www.learn engineering.in
Ec8395 ce by www.learn engineering.inEc8395 ce by www.learn engineering.in
Ec8395 ce by www.learn engineering.in
 
Sound analysis and processing with MATLAB
Sound analysis and processing with MATLABSound analysis and processing with MATLAB
Sound analysis and processing with MATLAB
 
Ee443 communications 1 - lab 2 - loren schwappach
Ee443   communications 1 - lab 2 - loren schwappachEe443   communications 1 - lab 2 - loren schwappach
Ee443 communications 1 - lab 2 - loren schwappach
 
The method of comparing two audio files
The method of comparing two audio filesThe method of comparing two audio files
The method of comparing two audio files
 

Plus de Loren Schwappach

EE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers LabEE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers LabLoren Schwappach
 
Ee325 cmos design lab 7 report - loren k schwappach
Ee325 cmos design   lab 7 report - loren k schwappachEe325 cmos design   lab 7 report - loren k schwappach
Ee325 cmos design lab 7 report - loren k schwappachLoren Schwappach
 
Ee325 cmos design lab 6 report - loren k schwappach
Ee325 cmos design   lab 6 report - loren k schwappachEe325 cmos design   lab 6 report - loren k schwappach
Ee325 cmos design lab 6 report - loren k schwappachLoren Schwappach
 
Ee325 cmos design lab 5 report - loren k schwappach
Ee325 cmos design   lab 5 report - loren k schwappachEe325 cmos design   lab 5 report - loren k schwappach
Ee325 cmos design lab 5 report - loren k schwappachLoren Schwappach
 
Ee325 cmos design lab 4 report - loren k schwappach
Ee325 cmos design   lab 4 report - loren k schwappachEe325 cmos design   lab 4 report - loren k schwappach
Ee325 cmos design lab 4 report - loren k schwappachLoren Schwappach
 
Ee325 cmos design lab 3 report - loren k schwappach
Ee325 cmos design   lab 3 report - loren k schwappachEe325 cmos design   lab 3 report - loren k schwappach
Ee325 cmos design lab 3 report - loren k schwappachLoren Schwappach
 
Loren k. schwappach ee331 - lab 4
Loren k. schwappach   ee331 - lab 4Loren k. schwappach   ee331 - lab 4
Loren k. schwappach ee331 - lab 4Loren Schwappach
 
Loren k. schwappach ee331 - lab 3
Loren k. schwappach   ee331 - lab 3Loren k. schwappach   ee331 - lab 3
Loren k. schwappach ee331 - lab 3Loren Schwappach
 
Ee343 signals and systems - lab 2 - loren schwappach
Ee343   signals and systems - lab 2 - loren schwappachEe343   signals and systems - lab 2 - loren schwappach
Ee343 signals and systems - lab 2 - loren schwappachLoren Schwappach
 
Ee343 signals and systems - lab 1 - loren schwappach
Ee343   signals and systems - lab 1 - loren schwappachEe343   signals and systems - lab 1 - loren schwappach
Ee343 signals and systems - lab 1 - loren schwappachLoren Schwappach
 
Ee 352 lab 1 (tutorial) - schwappach - 15 oct 09
Ee 352   lab 1 (tutorial) - schwappach - 15 oct 09Ee 352   lab 1 (tutorial) - schwappach - 15 oct 09
Ee 352 lab 1 (tutorial) - schwappach - 15 oct 09Loren Schwappach
 
EE375 Electronics 1: lab 3
EE375   Electronics 1: lab 3EE375   Electronics 1: lab 3
EE375 Electronics 1: lab 3Loren Schwappach
 
EE375 Electronics 1: lab 1
EE375   Electronics 1: lab 1EE375   Electronics 1: lab 1
EE375 Electronics 1: lab 1Loren Schwappach
 
Ee395 lab 2 - loren - victor - taylor
Ee395   lab 2 - loren - victor - taylorEe395   lab 2 - loren - victor - taylor
Ee395 lab 2 - loren - victor - taylorLoren Schwappach
 
Ee395 lab 1 - bjt - loren - victor - taylor
Ee395   lab 1 - bjt - loren - victor - taylorEe395   lab 1 - bjt - loren - victor - taylor
Ee395 lab 1 - bjt - loren - victor - taylorLoren Schwappach
 
5 ee415 - adv electronics - presentation - schwappach
5   ee415 - adv electronics - presentation - schwappach5   ee415 - adv electronics - presentation - schwappach
5 ee415 - adv electronics - presentation - schwappachLoren Schwappach
 
4 ee414 - adv electroncs - lab 3 - loren schwappach
4   ee414 - adv electroncs - lab 3 - loren schwappach4   ee414 - adv electroncs - lab 3 - loren schwappach
4 ee414 - adv electroncs - lab 3 - loren schwappachLoren Schwappach
 
3 ee414 - adv electroncs - lab 2 - loren schwappach
3   ee414 - adv electroncs - lab 2 - loren schwappach3   ee414 - adv electroncs - lab 2 - loren schwappach
3 ee414 - adv electroncs - lab 2 - loren schwappachLoren Schwappach
 
2 ee414 - adv electroncs - lab 1 - loren schwappach
2   ee414 - adv electroncs - lab 1 - loren schwappach2   ee414 - adv electroncs - lab 1 - loren schwappach
2 ee414 - adv electroncs - lab 1 - loren schwappachLoren Schwappach
 

Plus de Loren Schwappach (20)

Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
EE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers LabEE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers Lab
 
Ee325 cmos design lab 7 report - loren k schwappach
Ee325 cmos design   lab 7 report - loren k schwappachEe325 cmos design   lab 7 report - loren k schwappach
Ee325 cmos design lab 7 report - loren k schwappach
 
Ee325 cmos design lab 6 report - loren k schwappach
Ee325 cmos design   lab 6 report - loren k schwappachEe325 cmos design   lab 6 report - loren k schwappach
Ee325 cmos design lab 6 report - loren k schwappach
 
Ee325 cmos design lab 5 report - loren k schwappach
Ee325 cmos design   lab 5 report - loren k schwappachEe325 cmos design   lab 5 report - loren k schwappach
Ee325 cmos design lab 5 report - loren k schwappach
 
Ee325 cmos design lab 4 report - loren k schwappach
Ee325 cmos design   lab 4 report - loren k schwappachEe325 cmos design   lab 4 report - loren k schwappach
Ee325 cmos design lab 4 report - loren k schwappach
 
Ee325 cmos design lab 3 report - loren k schwappach
Ee325 cmos design   lab 3 report - loren k schwappachEe325 cmos design   lab 3 report - loren k schwappach
Ee325 cmos design lab 3 report - loren k schwappach
 
Loren k. schwappach ee331 - lab 4
Loren k. schwappach   ee331 - lab 4Loren k. schwappach   ee331 - lab 4
Loren k. schwappach ee331 - lab 4
 
Loren k. schwappach ee331 - lab 3
Loren k. schwappach   ee331 - lab 3Loren k. schwappach   ee331 - lab 3
Loren k. schwappach ee331 - lab 3
 
Ee343 signals and systems - lab 2 - loren schwappach
Ee343   signals and systems - lab 2 - loren schwappachEe343   signals and systems - lab 2 - loren schwappach
Ee343 signals and systems - lab 2 - loren schwappach
 
Ee343 signals and systems - lab 1 - loren schwappach
Ee343   signals and systems - lab 1 - loren schwappachEe343   signals and systems - lab 1 - loren schwappach
Ee343 signals and systems - lab 1 - loren schwappach
 
Ee 352 lab 1 (tutorial) - schwappach - 15 oct 09
Ee 352   lab 1 (tutorial) - schwappach - 15 oct 09Ee 352   lab 1 (tutorial) - schwappach - 15 oct 09
Ee 352 lab 1 (tutorial) - schwappach - 15 oct 09
 
EE375 Electronics 1: lab 3
EE375   Electronics 1: lab 3EE375   Electronics 1: lab 3
EE375 Electronics 1: lab 3
 
EE375 Electronics 1: lab 1
EE375   Electronics 1: lab 1EE375   Electronics 1: lab 1
EE375 Electronics 1: lab 1
 
Ee395 lab 2 - loren - victor - taylor
Ee395   lab 2 - loren - victor - taylorEe395   lab 2 - loren - victor - taylor
Ee395 lab 2 - loren - victor - taylor
 
Ee395 lab 1 - bjt - loren - victor - taylor
Ee395   lab 1 - bjt - loren - victor - taylorEe395   lab 1 - bjt - loren - victor - taylor
Ee395 lab 1 - bjt - loren - victor - taylor
 
5 ee415 - adv electronics - presentation - schwappach
5   ee415 - adv electronics - presentation - schwappach5   ee415 - adv electronics - presentation - schwappach
5 ee415 - adv electronics - presentation - schwappach
 
4 ee414 - adv electroncs - lab 3 - loren schwappach
4   ee414 - adv electroncs - lab 3 - loren schwappach4   ee414 - adv electroncs - lab 3 - loren schwappach
4 ee414 - adv electroncs - lab 3 - loren schwappach
 
3 ee414 - adv electroncs - lab 2 - loren schwappach
3   ee414 - adv electroncs - lab 2 - loren schwappach3   ee414 - adv electroncs - lab 2 - loren schwappach
3 ee414 - adv electroncs - lab 2 - loren schwappach
 
2 ee414 - adv electroncs - lab 1 - loren schwappach
2   ee414 - adv electroncs - lab 1 - loren schwappach2   ee414 - adv electroncs - lab 1 - loren schwappach
2 ee414 - adv electroncs - lab 1 - loren schwappach
 

Dernier

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Dernier (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

CTU: EE 443 Lab 3 - MATLAB FM Modulation, Detection & Noise

  • 1. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 1 Colorado Technical University EE 443 – Communication 1 Lab 2: MATLAB Project – Frequency Modulation / Detection and Noise September 2010 Loren K. Schwappach ABSTRACT: This lab report was completed as a course requirement to obtain full course credit in EE443, Communication 1 at Colorado Technical University. Given a message and a carrier signal, this lab report uses MATLAB to demonstrate the process of frequency modulation and demodulation of the message using a VCO. All of the code mentioned in this lab report was saved as a MATLAB m-file for convenience, quick reproduction, and troubleshooting of the code. All of the code below can also be found at the end of the report as an attachment, as well as all figures. All of the code and images created for this report are authentic and of my sole content. Since I finished 90 percent of this lab ahead of my struggling peers I shared snippets of my code with a few students (Shawn Malone, and Crystal Brandy) to aid in their understanding of the this lab and assisted them in working through Simulink although they will need to provide their own lab reports with their own content. If you have any questions or concerns in regards to this laboratory assignment, this laboratory report, the process used in designing the indicated circuitry, or the final conclusions and recommendations derived, please send an email to LSchwappach@yahoo.com. All computer drawn figures and pictures used in this report are of original and authentic content. Finally Simulink is used to show what happens to a I. INTRODUCTION sinusoidal signal after noise is added, and then removed via a The purpose of this lab is to learn how to low pass filter, next the signal is replaced with a square wave characterize a Frequency modulated (FM) signal input, finally the signal is passed though a slope detector and mathematically and simulate the frequency modulation of an analyzed. input signal using MATLABs Simulink software. This lab also serves as an introduction into the effects of noise on a system and how to plot noise in MATLAB. III. PROCEDURE / RESULTS The procedures used in this lab are illustrated by the II. OBJECTIVES included MATLAB code and Simulink diagrams in this report. There are three tasks that need to be completed for 1. Part 1 – FM Modulation in MATLAB this lab assignment. To begin this lab a time vector ‘t’ is created as well as The first task is to frequency modulate a signal in the corresponding message and carrier signal components as MATLAB and plot the FM signal in the time and frequency shown bellow... domain, and then select values of Beta which can simulate narrow band (NB) FM, wideband (WB) FM, and an FM signal % Generating Carrier, Message and Modulated wave Fc = 500; without a carrier (dropped carrier scenario). Ac = 2; Pc = 0; Fm = 25; The second task is to frequency modulate a signal Am = 1; using a Voltage-Controlled Oscillator (VCO) in Simulink and Pm = 0; then use a transfer function to simulate a slope detector Beta = 0; fs = 5000; %sampling frequency circuit such that the slope detector output is a combination of ts = 1/fs; %sampling interval FM and AM. t = 0:ts:((1/Fm)*3); %time vector The third and final tasks involves noise. First a noise Next the components were put together to display signal is generated and graphed in MATLAB, next the our message wave and carrier wave as shown below.. autocorrelation function of the noise signal is created.
  • 2. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 2 m = Am*sin(2*pi*Fm*t + Pm); %message wave c = Ac*sin(2*pi*Fc*t + Pc); %carrier wave The final FM modulated signal is of the form.. st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal This frequency modulated signal was then plot in the time domain and in the frequency domain using various values of Beta needed to demonstrate NB, WB, and carrier missing FM as shown. % ------- B = .1 Beta = .1; st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,st); %plots FM signal in time domain title('FM Signal (B=.1) - Time domain'); %adds title to graph Figure 2: FM Signal Beta = .1 in the frequency domain. xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph Notice there are very few sideband frequencies making up grid; %turns on grid the message signal thus the low bandwidth (Narrowband) axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=.1) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([400,600,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] Figure 1: FM Signal, Beta = .1 in the time domain. % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=.1) - 2 Sided Spectrum') %adds title to graph Figure 3: FM Signal Beta = .1 in the frequency domain xlabel('Freq (Hz)'); %adds xlabel to graph (Close-up). Notice there are very few sideband frequencies ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid making up the message signal thus the low bandwidth axis([-800,800,-.1,.4]); %defines axis (Narrowband) [x(min),x(max),y(min),y(max)]
  • 3. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 3 % ------- B = 5 Beta = 5; st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,st); %plots FM signal in time domain title('FM Signal (B=5) - Time domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] Figure 5: FM Signal Beta = 5 in the frequency domain. Notice there are many sideband frequencies making up the message signal thus the higher bandwidth (Wideband) % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=5) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([200,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] Figure 4: FM Signal, Beta = 5 in the time domain. % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=5) - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] Figure 6: FM Signal Beta = 5 in the frequency domain (close-up). Notice there are many sideband frequencies making up the message signal thus the higher bandwidth (Wideband)
  • 4. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 4 % ------- FM Signal with No Carrier Beta = 1; Ac = 0; %Carrier is no longer transmitting st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,st); %plots FM signal in time domain title('FM Signal (No carrier) - Time domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] Figure 8: FM Signal without a carrier in the frequency domain. No signals present because no carrier! % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (No carrier) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] Figure 7: FM Signal with no carrier (Ac = 0). Without a carrier you have no FM! % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (No carrier) - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] Figure 9: FM Signal without a carrier in the frequency domain (close-up). No signals present because no carrier!
  • 5. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 5 2. Part 2 – FM Modulation and Partial Demodulation in MATLAB For the next phase of the lab a new square wave message signal is now generated in MATLAB using a VCO in Simulink. The message frequency and carrier were chosen in such a way as to be easily visible by the scope. The modulation and settings used in Simulink are illustrated by the figures below. Figure 10: Simulink Block Diagram for FM Modulation Figure 11: Simulink Pulse generator settings for generating a 100Hz square wave.
  • 6. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 6 Figure 14: The output frequency modulated wave. Figure 12: VCO settings for Modulating the input signal. The quiescent frequency is the fc in FM and the Input sensitivity is the kf in FM. Thus this should adequately frequency modulate our message onto a 1k Hertz carrier with a high enough Kf to produce around two to four sidebands (wideband). Figure 15: The message square wave in the time domain. Notice a square wave has many low frequency components (> 0dB.) Figure 13: The output square wave in the time domain.
  • 7. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 7 Figure 18: As a result of positive slope detection we Figure 16: The FM wave in the frequency domain. Notice receive an FM-AM product. Using a good envelope there are about four sidebands >0dB representing our FM detector we could then attempt to demodulate our signal. wave. However a good envelope detector is a complex process and requires several block sets in MATLAB. Another Now that we have produced a good modulated wave approach is to use a phase-locked loop which was the next step is demodulation of the FM wave. The lab demonstrated in another class project. wished to demonstrate demodulation using a positive and negative slope detector simulated as transfer functions. However the next step following slope detection is envelope detection and an envelope detection module is not common to the Simulink library so this step could not be completed. Another approach to demodulation involved a phase-locked loop system, an easier process to manage in Simulink. Figure 19: The AM-FM wave in the frequency spectrum. 3. Part 2 – Noise Figure 17: Partial Demodulation of FM wave using a positive slope detector circuit in Simulink. The next and final phase of the lab involved creating and plotting a noise signal in MATLAB in the time and frequency domain, as well as the autocorrelation function of that noise. This accomplished with the following code... % Noise signal fs = 10000; %sampling frequency ts = 1/fs; %sampling interval t = 0:ts:1-ts; %time vector nt = rand([1,10000]); % returns an n-by-n matrix containing pseudorandom values
  • 8. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 8 % Plot of noise signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,nt); %plots noise in time domain title('Noise Signal - Time Domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid Figure 21: Noise signal in the frequency domain. Notice noise is very small (almost 0) at higher frequencies but an impulse at 0 Hz. This is as expected, which is why a small resistor can do wonders at eliminating LF noise! Now the autocorrelation function was found using the following code... % Plot of autocorrelation of n(t) Figure 20: Noise signal in the time domain. Rxx=xcorr(nt); % Estimate its autocorrelation ACorrPlot = figure; % Plot of noise signal in Frequency Domain plot(Rxx); % Plot the autocorrelation [Nf,NfRange] = centeredFFT(nt,fs); %Uses centeredFFT title('Autocorrelation Function of n(t)'); function xlabel('time shift - lags'); freqPlot = figure; %gives graph window a name and ylabel('Autocorrelation'); keeps it available grid; %turns on grid stem(NfRange,Nf); %Creates stem graph for magnitude spectrum title('Noise Signal - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid Figure 22: Autocorrelation function of noise signal. Finally Simulink was used to insert noise into a sinusoidal message signal, a low pass filter was used to eliminate the noise (while varying the noise). Lastly a square
  • 9. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 9 wave message was used and the output was again sent to the slope detector circuit for analysis. The results follow.. Figure 25: Message signal with large Gaussian noise after LP filter, notice you can now kind of see the message. Figure 23: Simulink circuit used for noise simulations. Figure 26: Message signal with smaller amount of Gaussian noise after a LP filter stage. Notice the noise is much less now. Figure 24: This is a representation of the message signal with large added Gaussian noise.
  • 10. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 10 Figure 29: After LP filtering out the noise, where is our signal? This is because a square wave contains many high frequency components that just got filtered out! Figure 27: Simulink block diagram used for Pulse generator (square wave input). Figure 30: Results of LP filtering our square wave with less noise added to the signal. Now we are getting somewhere, however we’ve still lost the form of our square wave. Figure 28: Large amount of noise added to square wave. If you can still call it that.
  • 11. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 11 IV. CONCLUSIONS The frequency modulation (FM) process was easy to simulate using MATLAB code. Beta’s influence in the bandwidth of an FM signal was further reinforced, as well as the concept of what drives frequency modulation (the carrier). Without a carrier there is nothing to modulate thus no FM signal. The Simulink modeling of an FM wave further improved my understanding and demonstrated that a slope detector can be used to create an FM-AM hybrid wave that’s AM potion can be envelope detected to retrieve a message signal. Graphing noise in MATLAB was a breeze and quite informative. By simulating the noise in Simulink a greater understanding of the drastic effects of noise on signals and the important use of specially designed filters. It was finally observed that noise plays an even greater role on digital systems such as a square wave which contains several frequency components. Isolating noise from such a system is even more difficult due to the increased number of frequency components (harmonics) making up the message. This was a satisfying lab and if I had further time I would have enjoyed fully demodulating the FM wave using an Figure 31: Simulink block diagram used for simulating additional negative slope detector and two envelope noise entering an FM modulation scheme. detectors. REFERENCES nd [1] Haykin, S., “Analog and Digital Communications 2 Edition” John Wiley & Sons, Haboken, NJ, 2007. Figure 32: FM Scheme with added large noise. No longer looks anything like FM!
  • 12. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 12 function Lab3 = Comm1Lab3() %Function name for calling in MATLAB % Colorado Technical University % EE 443 - Communications I % Lab 3 - MATLAB Project - Frequency Modulation/ Demodulation and Noise % By Loren K. Schwappach % Uses centeredFFT() for obtaining a two-sided spectrum % --------------------------- % ------- TASK 1 % Generating Carrier, Message and Modulated wave Fc = 500; Ac = 2; Pc = 0; Fm = 25; Am = 1; Pm = 0; Beta = 0; fs = 5000; %sampling frequency ts = 1/fs; %sampling interval t = 0:ts:((1/Fm)*3); %time vector m = Am*sin(2*pi*Fm*t + Pm); %message wave c = Ac*sin(2*pi*Fc*t + Pc); %carrier wave st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % ------- B = .1 Beta = .1; st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,st); %plots FM signal in time domain title('FM Signal (B=.1) - Time domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=.1) - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([-800,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=.1) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([400,600,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % ------- B = 5 Beta = 5; st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available
  • 13. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 13 plot (t,st); %plots FM signal in time domain title('FM Signal (B=5) - Time domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=5) - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (B=5) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([200,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % ------- FM Signal with No Carrier Beta = 1; Ac = 0; %Carrier is no longer transmitting st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal % Plot of FM signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,st); %plots FM signal in time domain title('FM Signal (No carrier) - Time domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,40e-3,-2,2]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of FM Signal in Frequency Domain [Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (No carrier) - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % Plot of Modulated Wave in Frequency Domain - Close Up freqPlot = figure; %gives graph window a name and keeps it available stem(SfRange,Sf); %Creates stem graph for magnitude spectrum title('FM Signal (No carrier) - Pos Spectrum Closeup') xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid axis([0,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)] % ------- End of Task 1
  • 14. CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 14 % --------------------------------------------- % ------- Task 2 is done with Simulink % --------------------------------------------- % ------- TASK 3 % Noise signal fs = 10000; %sampling frequency ts = 1/fs; %sampling interval t = 0:ts:1-ts; %time vector nt = rand([1,10000]); % returns an n-by-n matrix containing pseudorandom values % Plot of noise signal in Time Domain timePlot = figure; %gives graph window a name and keeps it available plot (t,nt); %plots noise in time domain title('Noise Signal - Time Domain'); %adds title to graph xlabel('Time (s)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid % Plot of noise signal in Frequency Domain [Nf,NfRange] = centeredFFT(nt,fs); %Uses centeredFFT function freqPlot = figure; %gives graph window a name and keeps it available stem(NfRange,Nf); %Creates stem graph for magnitude spectrum title('Noise Signal - 2 Sided Spectrum') %adds title to graph xlabel('Freq (Hz)'); %adds xlabel to graph ylabel('Amplitude'); %adds ylabel to graph grid; %turns on grid % Plot of autocorrelation of n(t) Rxx=xcorr(nt); % Estimate its autocorrelation ACorrPlot = figure; plot(Rxx); % Plot the autocorrelation title('Autocorrelation Function of n(t)'); xlabel('time shift - lags'); ylabel('Autocorrelation'); grid; %turns on grid % ------- End of Task 3 MATLAB code portion % --------------------------------------------- % end Comm1Lab3