Sie sind auf Seite 1von 3

ELEC3163DigitalSignalProcessing Lab3BasicSamplingTheory Objective: The objective of this lab is (1) to be familiar with the signals in time domain and

and frequency domain. (2) to use different projects to illustrate the basic principles of the sampling process. In the first project, aliasing is investigated for sine wave and for chirp signals.Thesesignalsshouldbelistenedtobeforeandaftersampling. 1. Signalsintimeandfrequencydomain. closeall; N=10; square=[zeros(1,N),ones(1,N*N),zeros(1,N)]; square_freq_domain=fft(square); figure; subplot(2,1,1) stem(square) subplot(2,1,2) plot(abs(square_freq_domain)); (1) Typetheaboveprogramintocomputerandsavethemasyourname_lab31.m. (2) Runtheaboveprogram. (3) Change the ones(1, N*N) to ones(1, N), run the program again to observe the differenceofthefigures.Addcommentsinyourreport. (4) Change the ones(1, N) to ones(1,N/2), run the program again to observe the differenceofthefigure.Addcommentsinyourreport. closeall; N=1000; f=10; n=(1:N); sinwave=sin(2*pi*f*n/(N1)); sinwave_freq_domain=fft(sinwave); figure; subplot(2,1,1) stem(sinwave) subplot(2,1,2) plot(abs(sinwave_freq_domain)); (5) Typetheaboveprogramintocomputerandsavethemasyourname_vlab32.m. (6) Runtheaboveprogram. (7) Change f to 50Hz, 80Hz, 100Hz, 200Hz, 300Hz, 400Hz, 500Hz and 600Hz respectively, run the program at the different frequencies and observe the differenceofthefigures.Commentsinyourreport.

2. BasicSamplingtheoryandaliasingofasinusoid Considertheformulaforacontinuoustimesinusoidalsignal: x(t ) = sin(2f 0 t + ) Wecansample x(t ) atarate f s = 1 / Ts toobtainadiscretesignal f x[n] = x(t ) (t = nTs ) = x(t ) (t = n / f ) s = sin( 2 0 n + ) fs If we make plots of x(n) for different combinations of f 0 and f s , the aliasing problem canbeillustrated.Forthefollowing,takethesamplingfrequencytobe f s = 8kHz (a) First of all, make a single plot of a sampled sine wave. Let the frequency of the sine wave be 300Hz, and take samples over an interval of 10ms. The phase can be arbitrary. Plot the resulting discretetime signal using stem. It should be easyto see the outline of the sinusoidal, becauseyour eyesperformareconstructionvisualizingtheenvelopeofthesignal. (b) If necessary, make the plot using plot. In this case, the points are connected with straight lines, so the sinusoidal behavior should be obvious. Connecting the signal samples with straight lines is a form of signal reconstruction that makes a continuoustime signal from the discretetime samples. It is not the ideal reconstruction specified by the samplingtherem,butitisgoodenoughtobeusefulonmostsituations. (c) Now make a series plots. Just like part(a), but vary the sinusoidal frequency form 100 to 475, in steps of 125. Note that that apparent frequency of the sinusoidal is increasing, as is expected. It might be bettertousesubplottoputfourplotsononescreen. (d) Make another series of plots, just as in part(c), but vary the sinusoidal frequency from 7525 to 7900Hz., in steps of 125Hz. Note that the apparent frequency of the sinusoid is now decreasing. Explain this phenomenon. (e) Again make a similar series of plots. But vary the sinusoidal frequency from 32100 to 32475Hz, in steps of 125Hz. Predict in advance whether theapparentfrequencywillbeincreasingordecreasing. 3. Aliasingachirpsignal A linear frequencymodulated signal makes a good test for aliasing, because the frequencymovesoverarange.Thissignalisoftencalledachirp,duetotheaudile sound it makes when played thought a speaker. The mathematical definition of a chirpis: c(t ) = cos(t 2 + 2f1t + ) The instantaneous frequency of this signal can be found by take the time derivative ofthephase.Theresultis: f i (t ) = t + f1

whichexhibitsalinearvariationversustime. (f) taketheparametersofthechirptobe f1 = 4kHz and = 600kHz / s and arbitrary. Ifthe total time duration of thechirp is 50ms, determine the frequencyrangethatiscoveredbythesweptfrequencyofthechirp. (g) Let the sampling frequency be fs=8kHz. Plot the discretetime samples of thechirpusingthestemandplot.Sincethesweptbandwidthofthechirp exceedsthesamplingfrequency,therewillbealiasing. (h) Notice that the chirp signal exhibits intervals in time where the apparent frequency gets very low. In fact, the instantaneous frequency is passing though zero at these points. Determine from the plots the times when this happens. Verify that these are the correct times by checking where thealiasingofthesweptfrequencyoccurs. (i) Answerquestion(a)and(c).Printyourprogramcodesandthefigure.

Das könnte Ihnen auch gefallen