P. 1
2010-9-16 Lab Report 3

2010-9-16 Lab Report 3

|Views: 182|Likes:
Published by Ganesh_Kailas_8696

More info:

Published by: Ganesh_Kailas_8696 on Sep 21, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Frequency Modulation/Demodulation


Frequency Modulation/Demodulation and Noise (September 2010)
Jenna Rock
figure(2); plot(w,Mmag); axis ([-10000 10000 0 2]); title (Narrow Band FM - B=1'); xlabel ('Frequency (Hz)'); ylabel ('Magnitude')

Abstract—This goal in completing this project is to build an understanding of frequency modulation, demodulation and noise effects.



HE purpose of this lab is to use and characterize Frequency Modulation using Matlab and Simulink. In addition to this the effects of noise will be observed.

II. THE FIVE QUESTIONS The following sections will discuss what was done for each part and the code needed to graph the function. Following that, the graph itself will be looked at. A. Frequency Modulation in Matlab For this first part of the lab frequency modulation is what is being demonstrated. Different betas will be chosen in order to show Narrow band FM, Wideband FM, and no carrier. Here is the MATLAB code that fulfilled the requirements. Ac = 10; fc = 5000; Am1 = 5; fm = 1000; fs = 10 * fc; ts = 1/fs; t = 0:ts:1-ts; %Narrow Band FM B = 1.0; m = Am1 * sin(2*pi*fc*t+B*sin(2*pi*fm*t)); c = Ac * sin(2*pi*fc*t); s = m.* c; figure(1); plot (t, m); axis ([0 0.00250 -10 10]); title ('Message Signal – Narrow Band FM'); xlabel ('Time (s)'); ylabel ('Magnitude') %% Frequency Spectrum of M(f) and S(f)for Narrow Band FM Figure 2: Narrow Band FM - B=1 N=4096; Mmag = abs(fftshift(fft(m,N)))/N; w = fs * [-N/2+1:N/2]/N; %% Wide Band FM B=5; m = Am1 * sin(2*pi*fc*t+B*sin(2*pi*fm*t)) ; Figure 1: Message Signal - Narrow Band FM

B=0'). Mmag = abs(fftshift(fft(m. ylabel ('Magnitude') Figure 5: Message Signal . axis ([-6000 6000 0 2]). m).00250 -10 10]).Frequency Modulation/Demodulation figure(3). title ('Message Signal – Wide Band FM'). axis ([0 0. figure(4). w = fs * [-N/2+1:N/2]/N.00250 -10 10]).N)))/N. xlabel ('Frequency (Hz)'). figure(6). Mmag = abs(fftshift(fft(m. plot(w. xlabel ('Time (s)'). plot (t. ylabel ('Magnitude') %% Frequency Spectrum of M(f) for Wide Band FM N=4096. plot (t.Mmag). m). xlabel ('Frequency (Hz)').B=5 %%No Carrier B=0.Mmag). axis ([-15000 15000 0 2]).Wide Band FM Figure 4: Wide Band FM . w = fs * [-N/2+1:N/2]/N. ylabel ('Magnitude') 2 m = Am1 * sin(2*pi*fc*t+B*sin(2*pi*fm*t)) . xlabel ('Time (s)').N)))/N. title ('Message Signal – No Carrier').B=5'). Figure 6: No Carrier . title ('Figure 6: No Carrier . figure(5). title ('Wide Band FM . axis ([0 0. ylabel ('Magnitude') N=4096. plot(w. The figures for each section of code have been put after each section.No Carrier Figure 3: Message Signal . the . As can be seen there were three sections.B=0 For this first part the code is provided for the solution.

All of these sections were the same. Figure 10: Output from Scope1 3 C. grid.nt).Time Domain').Frequency Modulation/Demodulation narrow band FM. Here is the MATLAB code that fulfilled the requirements. % Noise signal fs = 10000. ylabel('Amplitude'). pause Figure 8: Output from Scope2 % Plot of autocorrelation of n(t) Rxx=xcorr(nt). xlabel('Time (s)'). grid. timePlot = figure. freqPlot = figure. ACorrPlot = figure. title('Noise Signal . ylabel('Autocorrelation').2 Sided Spectrum') xlabel('Freq (Hz)').10000]). plot(Rxx). Also the figures were labeled differently. Frequency Modulation and Demodulation in Simulink For the second part of the lab Frequency Modulation will be demonstrated as well as how to demodulate is. Figure 7: Frequency Modulation and Demodulation The message and the dc offset were added together then were sent through a voltage controlled oscillator (VCO). This will be shown in both Matlab and Simulink. The graphs produced by this Simulink block can be seen in Figure 8. plot (t. wide band FM. B. nt = rand([1. t = 0:ts:1-ts. Figure 9: Output from Scope . title('Noise Signal .fs). ylabel('Amplitude'). stem(NfRange.lags'). At the end of the VCO the modulated signal was then put through a slope detector. Figure 9 and Figure 10. and the no carrier. except that the beta was change to achieve the various FM types. xlabel('time shift .Nf). ts = 1/fs. Here is the Simulink model that fulfilled the requirements.NfRange] = centeredFFT(nt. grid % Plot of noise signal in Frequency Domain [Nf. Noise This part of the lab will show the effect of noise in frequency modulation. title('Autocorrelation Function of n(t)').

However. REFERENCES [1] J.Frequency Modulation/Demodulation 4 Figure 14: Output from Scope Figure 11: Autocorrelation in Time Domain Here is the block diagram that fulfills the requirements for the Simulink part of noise. Figure 12: Noise Effects in Simulink The message is added first with a dc offset. “Lab 3 – Frequency Modulation/Demodulation and Noise” handout. and Figure 15. This lab showed that only a very basic understanding of FM has been grasped. Figure 13: Output from Scope2 . CONCLUSION Looking back at the completion of this MATLAB project. Santiago. it would need to be said that there is a lot more to be learned about Frequency Modulation than one lab can provide. Also the effects of noise were observed. If someone really wants to learn about FM much more time needs to be spent. After this the signal plus noise is sent through a VCO and then a low pass filter or slope detector. Figure 15: Output from Scope1 III. Figure 14. this lab did fulfill its purpose in that FM modulation and demodulation was demonstrated. The lab was complete but not without great difficulty. The graphs produced by this Simulink block can be seen in Figure 13. Following this the resultant signal has added to it noise.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->