The Fourier representation of a signal via the forward and inverse DTFT is a key
ID: 2085943 • Letter: T
Question
The Fourier representation of a signal via the forward and inverse DTFT is a key part of signal analysis. The analysis and synthesis equations are respectively, X(e^j omega) = sigma^infinity_n = -infinity x(n) e^j omega n x(n) = 1/2pi integral^-pi_pi X(e^j omega) e^j omega n d omega The frequency response of an LTI system is the DTFT of its impulse response. Suppose that a rectangular pulse x(n) is defined by x(n) = {1, 0 lessthaorequalto n lessthanorequalto L -1 0, elsewhere (a) Use the function dtft to evaluate the DTFT of a 20-point pulse. Plot of the magnitude and phase responses (DTFT versus omega over the range: omega = -pi to pi) (c) To make the plot appear smooth, choose a number of frequency samples that is 5 to 10 times the pulse length. Experiment with different numbers of frequency samples. Be careful to label the frequency axis correctly for the variable omega, when plotting. Check the zero locations and the peak height and report on your observations. (d) Notice that the zeros of the asinc function are at regularly spaced locations. Repeat part(a) for an odd length pulse, say 25-point pulse.Explanation / Answer
fs=10; % sampling frequency Hz
Ts=1/fs;
T=4; % length of time vector in seconds
t=-T/2:Ts:T/2-Ts; %vector of 40 time samples -2:0.1:1.9
y=rectpuls(t); %unit length rect impulse
z=fft(y,10000).*Ts;
%fft multiplied by Ts to get rid of the 1/Ts factor in the spectral replicas
%of the DTFT of the signal
f=linspace(0, (length(z)-1)/length(z),length(z));
figure
plot(f,abs(z));
grid on
%plot of the phase of z as it is, so with the time sequence
%considered to be shifted by length(y)/2 samples by fft.
figure
plot(f,unwrap(angle(z)),'r');
grid on
%I try to get rid of the linear phase delay component to get the phase
%spectrum of the DTFT of the signal in its frequency period.
%I divide each fft sample by its own exponential delay factor.
delay=length(y)/(2*length(z));
expd=zeros(1,length(z));
for index=1:1:length(z)
expd(index)=exp(-1i*2*pi*(index-1)*delay);
end
z2=z./expd;
figure
plot(f,unwrap(angle(z2))./pi,'r');
grid on
% Evaluation of the DTFT clf;
% Compute the frequency samples of the DTFT
w = -4*pi:8*pi/511:4*pi;
num = [2 1];den = [1 -0.6];
h = freqz(num, den, w);
% Plot the DTFT subplot(2,1,1)
plot(w/pi,real(h));
grid title(’Real part of H(e^{jomega})’)
xlabel(’omega /pi’); ylabel(’Amplitude’);
subplot(2,1,2) plot(w/pi,imag(h));
grid title(’Imaginary part of H(e^{jomega})’) xlabel(’omega /pi’);
ylabel(’Amplitude’);
pause subplot(2,1,1) plot(w/pi,abs(h));
grid title(’Magnitude Spectrum |H(e^{jomega})|’) xlabel(’omega /pi’);
ylabel(’Amplitude’);
subplot(2,1,2) plot(w/pi,angle(h));
grid title(’Phase Spectrum arg[H(e^{jomega})]’) xlabel(’omega /pi’);
ylabel(’Phase, radians’);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.