comparison m-toolbox/classes/@specwin/win_kaiser.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % WIN_KAISER returns Kaiser window, with N points and psll peak sidelobe level.
2 % If mode == 'define', the window values will be empty and all the features
3 % If mode == 'build', the window values will be calculated
4 %
5 % A Grynagier 03/01/2010
6 %
7 % $Id: win_kaiser.m,v 1.2 2011/05/25 07:30:08 mauro Exp $
8 %
9
10 function varargout = win_kaiser(w, mode, N, psll)
11
12 switch lower(mode)
13
14 case 'build'
15 n_args = nargin;
16 if n_args < 3
17 N = w.len;
18 end
19
20 % Compute window samples
21 % - here we adjust to make the window asymmetric
22 v = kaiser(N+1, pi*w.alpha)';
23 varargout{1} = v(1:end-1);
24
25 case 'define'
26 % Make window struct
27 w.type = 'Kaiser';
28 w.alpha = specwin.kaiser_alpha(psll);
29 w.psll = psll;
30 w.rov = specwin.kaiser_rov(w.alpha);
31 w.nenbw = specwin.kaiser_nenbw(w.alpha);
32 w.w3db = specwin.kaiser_w3db(w.alpha);
33 w.flatness = specwin.kaiser_flatness(w.alpha);
34 w.len = N;
35 w.skip = 0;
36
37 varargout{1} = w;
38 end