Matlab Assignment 2 (Questions only) PDF

Title Matlab Assignment 2 (Questions only)
Course Introduction to Digital Signal Processing
Institution Oklahoma State University
Pages 3
File Size 152.4 KB
File Type PDF
Total Downloads 87
Total Views 146

Summary

I hope you like Matlab. For Dr. Teague's fall 2017 class....


Description

Introduction to DSP ECEN 4763 Fall 2017 Matlab Assignment #2 Sampling and Aliasing Purpose: This assignment will use Matlab to illustrate aliasing, a phenomenon that occurs when the sampling frequency is less than twice the highest frequency in the signal being sampled. Chirped sinusoids will be used for simplicity, but the concepts are equally applicable to arbitrary signals. Sampling and Aliasing: As discussed in class, aliasing occurs whenever the sampling frequency is not sufficiently high to accommodate the signal being sampled. Aliasing is sometimes described as a (destructive) mapping of higher frequencies onto lower frequencies in the spectrum. In this problem you will generate test signals of known frequency and then examine the effect sampling has on the discrete time representation. In particular, you will observe that the apparent frequency of a sinusoid will be different than the actual frequency whenever aliasing occurs. This effect generalizes to arbitrary signals with aliasing. Since Matlab can only deal with sequences (sampled signals) we must simulate the sampling of continuous time signals. We will do this by starting with the definition of a continuous time signal and then substitute a discrete time variable for t. 1. Aliased Chirped Sinusoids A chirp signal is a sinusoid that has a frequency that varies with time. In particular, a chirped sinusoid begins at one frequency and smoothly moves to another frequency over a time interval. Another equivalent way to describe a chirp signal is as a linear frequencymodulated signal. A typical chirped sinusoidal signal can be written as c(t)  cos( t 2  21f t  ). The instantaneous frequency of this sinusoid can be found by computing the time derivative of the phase, which can be written as fi (t)  t  f1 , which clearly exhibits a linear frequency variation with time.

a) Assume the parameters for the chirp are given to be f1  0kHz ,   600kHz / s , and  an arbitrary constant. Let the total time duration of the chirp be 25 ms. This signal should begin at zero frequency and sweep linearly upward in frequency. Calculate the frequency range that is covered by the swept frequency of the chirp in the specified time interval (beginning at time zero). b) Now let the sampling frequency be 8,000 Hz and compute samples of the chirp signal defined in (a) above. In order to compute the sampled chirp signal you must substitute nTs for t and evaluate the equation for the desired number of points or for the specified time interval. A method for doing this with Matlab is as follows – n=0:1:8000*(.025); Ts=1/8000; nTs=n*Ts; u=600000; f1=0; phi=0; c=cos(pi*u*nTs.*nTs+2*pi*f1*nTs+phi); The first line generates a vector of integers beginning at zero, incrementing by one, and covering the 25 ms time duration of the signal. This corresponds to the indices of the sequence. Ts is the sampling interval. nTs is a vector of times where the cosine is to be sampled. The last line computes the vector of signal values evaluated at times nTs. Note the use of the Matlab operator “.*” which performs the point-by-point product (squaring, in this case) of two vectors. Plot the discrete-time samples of the chirp signal using the plot function for the 25 ms duration signal. The swept bandwidth of the chirp signal will exceed the Nyquist frequency so there will be aliasing. Knowing that the chirp should begin at zero frequency and sweep linearly upward in frequency, explain the appearance of the plot. Include a copy of your plot along with the explanation. c) Generate and plot the sampled chirp signal again, but this time use a 50 ms interval of data with everything else the same. Notice that there are intervals in time where the apparent frequency of the chirp signal gets very low (the instantaneous frequency is passing through zero Hertz at these points). Determine from the plots the approximate times when this happens, and determine from the analog chirp signal what the actual frequency (in Hertz) of the chirp is at each of these times. It may help to zoom in on interesting areas so they can be more closely examined. Label each of these spots on the plot with the actual frequency of the continuous time chirp signal. Briefly justify the effect that is occurring at these times based on your newfound knowledge of aliasing.

2. Report Turn in electronically a short report as a PDF document including all your plots, calculations, and brief discussion, neatly assembled. Copy and paste your plots, etc., into the document in order to produce a single attractive and unified document to turn in. Be sure all the components (plots, calculations, discussion, etc.) are properly and clearly labeled. This assignment is due in the OC dropbox created for it on Friday, October 27 not later than the beginning of class as before....


Similar Free PDFs