• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf
 

EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf

on

  • 2,254 views

EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf

EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf

Statistics

Views

Total Views
2,254
Views on SlideShare
2,253
Embed Views
1

Actions

Likes
1
Downloads
154
Comments
0

1 Embed 1

http://www.docseek.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 3 - Loren Schwappach.pdf Document Transcript

    • 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 todemonstrate the process of frequency modulation and demodulation of the message using a VCO. All of the code mentionedin this lab report was saved as a MATLAB m-file for convenience, quick reproduction, and troubleshooting of the code. All ofthe 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 imagescreated for this report are authentic and of my sole content. Since I finished 90 percent of this lab ahead of my struggling peersI shared snippets of my code with a few students (Shawn Malone, and Crystal Brandy) to aid in their understanding of the thislab and assisted them in working through Simulink although they will need to provide their own lab reports with their owncontent. If you have any questions or concerns in regards to this laboratory assignment, this laboratory report, the processused in designing the indicated circuitry, or the final conclusions and recommendations derived, please send an email toLSchwappach@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 wavecharacterize a Frequency modulated (FM) signal input, finally the signal is passed though a slope detector andmathematically and simulate the frequency modulation of an analyzed.input signal using MATLABs Simulink software. This lab alsoserves as an introduction into the effects of noise on a systemand 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 MATLABthis 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 asMATLAB and plot the FM signal in the time and frequency shown bellow...domain, and then select values of Beta which can simulatenarrow 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 frequencycircuit such that the slope detector output is a combination of ts = 1/fs; %sampling intervalFM 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 displaysignal 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 2m = Am*sin(2*pi*Fm*t + Pm); %message wavec = 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)); %FMsignal This frequency modulated signal was then plot in thetime domain and in the frequency domain using variousvalues of Beta needed to demonstrate NB, WB, and carriermissing FM as shown.% ------- B = .1Beta = .1;st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FMsignal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name andkeeps it availableplot (t,st); %plots FM signal in time domaintitle(FM Signal (B=.1) - Time domain); %adds titleto graph Figure 2: FM Signal Beta = .1 in the frequency domain.xlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graph Notice there are very few sideband frequencies making upgrid; %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 centeredFFTfunctionfreqPlot = figure; %gives graph window a name andkeeps it availablestem(SfRange,Sf); %Creates stem graph for magnitudespectrumtitle(FM Signal (B=.1) - 2 Sided Spectrum) %addstitle to graph Figure 3: FM Signal Beta = .1 in the frequency domainxlabel(Freq (Hz)); %adds xlabel to graph (Close-up). Notice there are very few sideband frequenciesylabel(Amplitude); %adds ylabel to graphgrid; %turns on grid making up the message signal thus the low bandwidthaxis([-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 = 5Beta = 5;st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FMsignal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name andkeeps it availableplot (t,st); %plots FM signal in time domaintitle(FM Signal (B=5) - Time domain); %adds titleto graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 centeredFFTfunctionfreqPlot = figure; %gives graph window a name andkeeps it availablestem(SfRange,Sf); %Creates stem graph for magnitudespectrumtitle(FM Signal (B=5) - 2 Sided Spectrum) %addstitle to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([-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 CarrierBeta = 1;Ac = 0; %Carrier is no longer transmittingst = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FMsignal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name andkeeps it availableplot (t,st); %plots FM signal in time domaintitle(FM Signal (No carrier) - Time domain); %addstitle to graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 acarrier you have no FM!% Plot of FM Signal in Frequency Domain[Sf,SfRange] = centeredFFT(st,fs); %Uses centeredFFTfunctionfreqPlot = figure; %gives graph window a name andkeeps it availablestem(SfRange,Sf); %Creates stem graph for magnitudespectrumtitle(FM Signal (No carrier) - 2 Sided Spectrum)%adds title to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([-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 wavemessage signal is now generated in MATLAB using a VCO inSimulink. The message frequency and carrier were chosen insuch a way as to be easily visible by the scope. Themodulation and settings used in Simulink are illustrated bythe 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 Inputsensitivity is the kf in FM. Thus this should adequatelyfrequency modulate our message onto a 1k Hertz carrierwith a high enough Kf to produce around two to foursidebands (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 weFigure 16: The FM wave in the frequency domain. Notice receive an FM-AM product. Using a good envelopethere 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 wasthe next step is demodulation of the FM wave. The lab demonstrated in another class project.wished to demonstrate demodulation using a positive andnegative slope detector simulated as transfer functions.However the next step following slope detection is envelopedetection and an envelope detection module is not commonto the Simulink library so this step could not be completed.Another approach to demodulation involved a phase-lockedloop system, an easier process to manage in Simulink. Figure 19: The AM-FM wave in the frequency spectrum. 3. Part 2 – NoiseFigure 17: Partial Demodulation of FM wave using apositive 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 DomaintimePlot = figure; %gives graph window a name andkeeps it availableplot (t,nt); %plots noise in time domaintitle(Noise Signal - Time Domain); %adds title tographxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %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 gridstem(NfRange,Nf); %Creates stem graph for magnitudespectrumtitle(Noise Signal - 2 Sided Spectrum) %adds titleto graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %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 9wave message was used and the output was again sent to theslope 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 signalwith 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 Pulsegenerator (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 anFigure 31: Simulink block diagram used for simulating additional negative slope detector and two envelopenoise 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 longerlooks anything like FM!
    • CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 12function 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 waveFc = 500;Ac = 2;Pc = 0;Fm = 25;Am = 1;Pm = 0;Beta = 0;fs = 5000; %sampling frequencyts = 1/fs; %sampling intervalt = 0:ts:((1/Fm)*3); %time vectorm = Am*sin(2*pi*Fm*t + Pm); %message wavec = Ac*sin(2*pi*Fc*t + Pc); %carrier wavest = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal% ------- B = .1Beta = .1;st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name and keeps it availableplot (t,st); %plots FM signal in time domaintitle(FM Signal (B=.1) - Time domain); %adds title to graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 functionfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (B=.1) - 2 Sided Spectrum) %adds title to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([-800,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]% Plot of Modulated Wave in Frequency Domain - Close UpfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (B=.1) - Pos Spectrum Closeup)xlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([400,600,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]% ------- B = 5Beta = 5;st = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name and keeps it available
    • CTU: EE 443 – Communications 1: Lab 3: MATLAB Project – Frequency Modulation / Detection and Noise 13plot (t,st); %plots FM signal in time domaintitle(FM Signal (B=5) - Time domain); %adds title to graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 functionfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (B=5) - 2 Sided Spectrum) %adds title to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]% Plot of Modulated Wave in Frequency Domain - Close UpfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (B=5) - Pos Spectrum Closeup)xlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([200,800,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]% ------- FM Signal with No CarrierBeta = 1;Ac = 0; %Carrier is no longer transmittingst = Ac*sin(2*pi*Fc*t+Beta*sin(2*pi*Fm*t)); %FM signal% Plot of FM signal in Time DomaintimePlot = figure; %gives graph window a name and keeps it availableplot (t,st); %plots FM signal in time domaintitle(FM Signal (No carrier) - Time domain); %adds title to graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 functionfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (No carrier) - 2 Sided Spectrum) %adds title to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([-1000,1000,-.1,.4]); %defines axis [x(min),x(max),y(min),y(max)]% Plot of Modulated Wave in Frequency Domain - Close UpfreqPlot = figure; %gives graph window a name and keeps it availablestem(SfRange,Sf); %Creates stem graph for magnitude spectrumtitle(FM Signal (No carrier) - Pos Spectrum Closeup)xlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on gridaxis([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 signalfs = 10000; %sampling frequencyts = 1/fs; %sampling intervalt = 0:ts:1-ts; %time vectornt = rand([1,10000]); % returns an n-by-n matrix containing pseudorandom values% Plot of noise signal in Time DomaintimePlot = figure; %gives graph window a name and keeps it availableplot (t,nt); %plots noise in time domaintitle(Noise Signal - Time Domain); %adds title to graphxlabel(Time (s)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on grid% Plot of noise signal in Frequency Domain[Nf,NfRange] = centeredFFT(nt,fs); %Uses centeredFFT functionfreqPlot = figure; %gives graph window a name and keeps it availablestem(NfRange,Nf); %Creates stem graph for magnitude spectrumtitle(Noise Signal - 2 Sided Spectrum) %adds title to graphxlabel(Freq (Hz)); %adds xlabel to graphylabel(Amplitude); %adds ylabel to graphgrid; %turns on grid% Plot of autocorrelation of n(t)Rxx=xcorr(nt); % Estimate its autocorrelationACorrPlot = figure;plot(Rxx); % Plot the autocorrelationtitle(Autocorrelation Function of n(t));xlabel(time shift - lags);ylabel(Autocorrelation);grid; %turns on grid% ------- End of Task 3 MATLAB code portion% ---------------------------------------------% end Comm1Lab3