Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following test signal: 2(t) = sin(2n( 1000)t) + sin(2n( 1100)t) + s

ID: 3860408 • Letter: C

Question

Consider the following test signal: 2(t) = sin(2n( 1000)t) + sin(2n( 1100)t) + sin(2n(3000)t) Generate an 0.0024 second sample of the signal (t) using a sample rate of 10,000 kilohertz. (The resulting signal r[n] should contain 25 samples). Using rectangular windows compute windowed esuting signal rm) should contain 25 samples). Using rectangular windows compute windowed DFT's of three different lengths: 25, 128, 1024. In other words, multiply x[n] by w[n], where w[n] is the appropriate 25-point window (rectangular) and then use Matlab's fft to compute the discrete Fourier transform. Note that the 128-point and 1024- point transforms will be zero-padded. Plot the magnitude of your results as a function of continuous- time frequency. See the Hints section for help in calculating the vector of frequencies to plot against. Answer the following questions Are you able to see from the frequency response magnitude that the signal contains three separate sinusoids? If so, for which DFT length can you distinguish the sinusoids? What does increasing the DFT length accomplish? . Hints on plotting the frequency responses Plotting the frequency response requires obtaining a vector of frequencies to plot against. As discussed in class, the discrete-time frequency vector may be defined as: w=(2*pi/N) *[ 0: (N-1) ] , ; % set up vector of omegas: 0 to 2pi In this case the samples range from 0 to 2. For plotting it is sometimes useful to have the samples go from to +. The fft shift command can be used to rearrange the samples of the spectrum for plotting this way, eg., xnew=fft shift (X). You will need a new vector of frequency samples to plot Xnew against.

Explanation / Answer

Copy the following code to a new script file in MATLAB. clear all; close all; clc; fs = 10000; t = 0:1/fs:0.0024; % time interval of x(t) x = sin(2*pi*1000*t) + sin(2*pi*1100*t) + sin(2*pi*3000*t); N = length(x); w = rectwin(N)'; y = x .* w; % sequen