h = [h(N/2+1:N),h(1:N/2)]; % zero-centered form (almost) hw = wzp .* h; % Apply window to ideal impulse response Hw = fft(hw); % Frequency response we really get % Compute total stopband attenuation: ierr = norm(Hw(N/2+2:N))/norm(Hw) = 0.0378 = 3.8 percentFor spectral displays, rotate buffer so negative frequencies are on the left and dc is at :
Hwp = [Hw(N/2+2:N), Hw(1:N/2+1)]; % Neg. freqs on left Hwpn = abs(Hwp); Hwpn = Hwpn/max(Hwpn); plot(f,20*log10(Hwpn)); grid; ...