Mercurial > hg > ltpda
comparison m-toolbox/classes/@specwin/win_nuttall3b.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_NUTTALL3B returns Nuttall3b window, with N points. | |
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 % M Hewitson 18-05-07 | |
6 | |
7 % | |
8 % $Id: win_nuttall3b.m,v 1.5 2011/05/25 07:30:09 mauro Exp $ | |
9 % | |
10 | |
11 function varargout = win_nuttall3b(w, mode, N) | |
12 | |
13 switch lower(mode) | |
14 | |
15 case 'build' | |
16 n_args = nargin; | |
17 if n_args < 3 | |
18 N = w.len; | |
19 end | |
20 % Calculate the values of the window | |
21 z = [0:N-1]./N * 2 * pi; | |
22 varargout{1} = 0.4243801 - 0.4973406 * cos (z) + 0.0782793 * cos (2 * z); | |
23 | |
24 case 'define' | |
25 % Make window struct | |
26 w.type = 'Nuttall3b'; | |
27 w.alpha = 0; | |
28 w.psll = 71.5; | |
29 w.rov = 59.8; | |
30 w.nenbw = 1.7037; | |
31 w.w3db = 1.6162; | |
32 w.flatness = -1.1352; | |
33 w.len = N; | |
34 w.skip = 0; | |
35 | |
36 varargout{1} = w; | |
37 end | |
38 | |
39 % END | |
40 |