Windowing a Desired Impulse Response Computed by the
Frequency Sampling Method

The next step is to apply our Kaiser window to the ``desired'' impulse response, where ``desired'' means a time-shifted (by 1/2 sample) and bandlimited (to introduce transition bands) version of the ``ideal'' impulse response in (4.22). In principle, we are using the frequency-sampling method4.4) to prepare a desired FIR filter of length $ N=4096$ as the inverse FFT of a desired frequency response prepared by direct Fourier intuition. This long FIR filter is then ``windowed'' down to length $ M=257$ to give us our final FIR filter designed by the window method.

If the smallest transition bandwidth is $ f_1$ Hz, then the FFT size $ N$ should satisfy $ N\gg f_s/f_1$ . Otherwise, there may be too much time aliasing in the desired impulse response.5.10 The only non-obvious part in the matlab below is ``.^8'' which smooths the taper to zero and looks better on a log magnitude scale. It would also make sense to do a linear taper on a dB scale which corresponds to an exponential taper to zero.

H = [ ([0:k1-2]/(k1-1)).^8,ones(1,k2-k1+1),...
      ([k1-2:-1:0]/(k1-1)).^8, zeros(1,N/2-1)];
Figure 4.11 shows our desired amplitude response so constructed.

Figure 4.11: Desired single-sideband-filter frequency response.

Now we inverse-FFT the desired frequency response to obtain the desired impulse response:

h = ifft(H); % desired impulse response
hodd = imag(h(1:2:N));     % This should be zero
ierr = norm(hodd)/norm(h); % Look at numerical round-off error
% Typical value: ierr = 4.1958e-15
% Also look at time aliasing:
aerr = norm(h(N/2-N/32:N/2+N/32))/norm(h);
% Typical value: 4.8300e-04
The real part of the desired impulse response is shown in Fig.4.12, and the imaginary part in Fig.4.13.

Figure 4.12: Real part of the desired single-sideband-filter impulse response.

Figure 4.13: Desired Hilbert-transform-filter impulse response.

Now use the Kaiser window to time-limit the desired impulse response:

% put window in zero-phase form:
wzp = [w((M+1)/2:M), zeros(1,N-M), w(1:(M-1)/2)];
hw = wzp .* h; % single-sideband FIR filter, zero-centered
Hw = fft(hw);  % for results display: plot(db(Hw));
hh = [hw(N-(M-1)/2+1:N),hw(1:(M+1)/2)]; % caual FIR
% plot(db(fft([hh,zeros(1,N-M)]))); % freq resp plot

Figure 4.14 and Fig.4.15 show the normalized dB magnitude frequency response of our final FIR filter consisting of the $ M$ nonzero samples of hw.

Figure 4.14: Frequency response of the Kaiser-windowed impulse response.

Figure 4.15: Zoomed frequency response of the Kaiser-windowed impulse response.

Next Section:
Special Cases
Previous Section:
Kaiser Window