Académique Documents
Professionnel Documents
Culture Documents
>> [X,f] = ctft(x,T); We can examine the frequency content of the reconstructed signal: >> plot(f,abs(X)); Is X nonzero at the proper frequency values? Now, lets choose a different sampling frequency s = 2(750) rad/sec, resulting in T = 1/750 sec. Lets create the samples and calculate the frequency content of the reconstructed signal: >> >> >> >> >> T=1/750; n=0:749; x=sin(2*pi*1000*n*T); [X,f] = ctft(x,T); plot(f,abs(X));
Do you see the expected spectrum? Why, or why not? (Hint: think about what is written on page 200 of the Lecture Notes). What is the Nyquist rate for this example? Try different values around the Nyquist rate for s , and examine the effect on the spectrum of the reconstructed signal.
we see there is room for further downsampling, since Xb (ej ) = 0 for > 4/5. Following the method of pages 225226 of the Lecture Notes, we see that the desired Nmax = 5/2 is not an integer value. So, we rst have to upsample by a factor of 2, then downsample by a factor of 5. We will use the Matlab function resample to upsample our signal. This function does the two-step process of inserting zeros and lowpass ltering that is required during upsampling. (See the Matlab help for more details.) Lets do this now: >> >> >> >> >> >> xu x3 Xu fu X3 f3 = = = = = = resample(x,2,1); xu(1:5:end); fft(xu); linspace(0,2*pi,length(Xu)); fft(x3); linspace(0,2*pi,length(X3));
Lets look in turn at the spectra of xu and x3. First, we look at the upsampled signal: >> plot(fu,abs(Xu)); and we observe that the upsampled signal has Xu (ej ) = 0 for > /5. Now, lets look at the spectrum of x3: >> plot(f3,abs(X3)); Observe the nal signal fully occupies up to . This means we have done the maximum possible (aliasing-free) downsampling of our signal x[n].