Write the frequency response and plot the magnitude response of the Appoint rect
ID: 2988802 • Letter: W
Question
Write the frequency response and plot the magnitude response of the Appoint rectangular, Dolph-Chebyshev window, and Kaiser windows. N = 2M + l = No. of Taps = 51. Rectangular window w(n) = 1, -M Dolph-Chebyshev window with a relative sidelobe level of 50 dB relative sidelobe amplitude = sidelobe amplitude / main lobe amplitude kth-order Chebyshev polynomial in x = Comment your observations in terms of mainlobe width and peak sidelobe level, (vertical axis: dB, horizontal axis: normalized frequency) Rectangular, Hanning, hamming, and Blackman windows are applied to x( pi ) for spectral analysis. Compute 16 and 1024 -pt DFT and plot the magnitude response of the windowed x(n). Comment on your observation in terms of spectral resolution.Explanation / Answer
2.
clear all;
close all;
f=input('enter the freq');
N=input('enter the number of samples');
w=2*pi*f;
alpha=(N-1)/2;
h=zeros(1,N);
for n=0:1:N-1
if n~=(N-1)/2
h(n+1)=sin(w*(n-alpha))/((n-alpha)*pi);
h(n+1)=1-h(n+1);
end
end
h(((N-1)/2)+1)=w/pi;
rectangular_window=boxcar(N);
ham=hamming(N);
han=hanning(N);
black=blackman(N);
h1=h.*rectangular_window';
h2=h.*ham';
h3=h.*han';
h4=h.*black';
w=0:.01:pi;
H1=freqz(h1,1,w);
H2=freqz(h2,1,w);
H3=freqz(h3,1,w);
H4=freqz(h4,1,w);
plot(w/pi,abs(H1),'r',w/pi,abs(H2),'g',w/pi,abs(H3),'y',w/pi,abs(H4));
additional information just for example
w1=hanning(100);
>> w2=hamming(100);
>> w3=blackman(100);
>> t=1:100;
>> plot(t,w1,'.r-',t,w2,'.g-',t,w3,'.b-');
>> xlabel('Time'); ylabel('Amplitude'); title('Window Comparison');
>> legend('Hanning','Hamming','Blackman'); grid on;
w4=kaiser(100,3);
>> w5=kaiser(100,5);
>> w6=kaiser(100,10);
>> t=1:100;
>> plot(t,w4,'.r-',t,w5,'.g-',t,w6,'.b-');
>> xlabel('Time'); ylabel('Amplitude'); title('Kaiser Window Comparison');
>> legend('b=3','b=5','b=10'); grid on;
d=load('wcr0301164.emg');
>> N=length(d);
>> t=(1:N)/10000;
>> x=d-mean(d);
>> w1=hamming(N);
>> y=x.*w1;
>> plot(t,x,'k',t,y,'r');
>> xlabel('Time (s)'); ylabel('Amplitude (V)'); title('wcr0301164.emg');
>> legend('Raw (zero mean)','After Hamming Window');
w0=ones(1,100);
>> wvtool(w1,w2,w3,w0);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.