Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Ads

Chapters

Chapter Contents:

Search Spectral Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Choice of Kaiser Window

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
replot
Note 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.

Figure B.8: The Kaiser window frequency response.
\includegraphics[width=3.5in]{eps/KaiserFR}

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 

Figure B.9: Close-up of the Kaiser window frequency response near dc.
\includegraphics[width=3.5in]{eps/KaiserZoomFR}


Order a Hardcopy of Spectral Audio Signal Processing

Previous: Hilbert Transform Design Example
Next: Windowing an ``Ideal'' Impulse Response

written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )