FIR Digital Filter Design
Hilbert Transform Design Example
Choice of Kaiser WindowSearch Spectral Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
w = kaiser(M,beta); % Kaiser window returned in "linear phase form" w = w'; % prefer row vectors for printing wzp = [w,zeros(1,N-M)]; % zero pad out to FFT size W = fft(wzp); Wp = [W(N/2+2:N), W(1:N/2+1)]; % plot (-) freqs on the left Wpn = abs(Wp); Wpn = Wpn/max(Wpn); plot(f,20*log10(Wpn)); grid; s = sprintf(... 'Kaiser Window Transform, FFT size = %d, Window length = %d',N,M); title(s); xlabel('Normalized Frequency (cycles/sample)'); ylabel('Gain (dB)') if dopause, disp 'Pausing... RETURN to continue'; pause; end; if saveplots, saveplot('KaiserFR.eps'); end;The function saveplot above is simply defined (for Matlab) as
function saveplot(filename) % SAVEPLOT - Save current plot to disk in a Post Script file. % This version is compatible only with Matlab. cmd = ['print -deps ',filename]; disp(cmd); eval(cmd);In Octave, the body may be defined instead as
gset output filename gset terminal postscript replotNote that in Octave you can also set the output terminal to fig, which is an ASCII file format understood by the xfig drawing program for X Windows systems such as Linux.
kzero = N/2; % index of frequency 0
kshow = 2*k1;
krange = kzero-kshow : kzero+kshow;
frange = (krange - kzero)/N;
plot(frange,20*log10(Wpn(krange))); grid;
s = sprintf(['Close Up on Kaiser LF Response, FFT size = %d',...
' Window length = %d'], N, M);
title(s);
xlabel('Normalized Frequency (cycles/sample)');
ylabel('Gain (dB)')
if saveplots, saveplot('KaiserZoomFR.eps'); end;
if dopause, disp 'Pausing... RETURN to continue'; pause; end;
wzp = [w((M+1)/2:M), zeros(1,N-M), w(1:(M-1)/2)]; % zero-phase
