You are on page 1of 3

3,

a, Code from Hw5_Ex3a_TruongCongThang.m


N = 32;
n = 0:1:N-1;
xn = sin(0.9*pi*n);
Mag_xn=abs(fft(xn));
subplot(2,1,1)
plot(Mag_xn)
title('Magnitude Response of Original X[k]')
wn=0.54 - 0.46*cos(2*pi*n/(N-1));
yn=xn.*wn;
Mag_yn=abs(fft(yn));
subplot(2,1,2)
plot(Mag_yn)
title('Magnitude Response of Windowed Signal Y[k]')
sgtitle('Truong Cong Thang')

We can see the result:

*Comment:
The magnitude response of the windowed signal Y[k] is shaper than the
original signal X[k].That means it reaches to the zero gain faster than the
original signal at high and low frequencies. It has a sharper fall down
too, at the mid-band range. Also the peak magnitude is also decreased.

b, Code from Hw5_Ex3b_TruongCongThang.m


N = 128;
n = 0:1:N-1;
xn = sin(0.9*pi*n);
Mag_xn=abs(fft(xn));
subplot(2,1,1)
plot(Mag_xn)
title('Magnitude Response of Original X[k]')
wn=0.54 - 0.46*cos(2*pi*n/(N-1));
yn = xn.*wn;
Mag_yn=abs(fft(yn));
subplot(2,1,2)
plot(Mag_yn)
title('Magnitude Response of Windowed Signal Y[k]')
sgtitle('Truong Cong Thang')

We can see the result:


*Comment:
The new result, X[k] has very less magnitude at mid-range. The peak
magnitude is increased. Y[k] has zero magnitudes at mid-range.

You might also like