Mercurial > hg > ltpda
comparison m-toolbox/classes/@specwin/win_nuttall3.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_NUTTALL3 returns Nuttall3 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 % $Id: win_nuttall3.m,v 1.5 2011/05/25 07:30:08 mauro Exp $ | |
8 % | |
9 function varargout = win_nuttall3(w, mode, N) | |
10 | |
11 switch lower(mode) | |
12 | |
13 case 'build' | |
14 n_args = nargin; | |
15 if n_args < 3 | |
16 N = w.len; | |
17 end | |
18 % Calculate the values of the window | |
19 z = [0:N-1]./N * 2 * pi; | |
20 varargout{1} = 0.375 - 0.5 * cos (z) + 0.125 * cos (2 * z); | |
21 | |
22 case 'define' | |
23 % Make window struct | |
24 w.type = 'Nuttall3'; | |
25 w.alpha = 0; | |
26 w.psll = 46.7; | |
27 w.rov = 64.7; | |
28 w.nenbw = 1.9444; | |
29 w.w3db = 1.8496; | |
30 w.flatness = -0.8630; | |
31 w.len = N; | |
32 w.skip = 0; | |
33 | |
34 varargout{1} = w; | |
35 end | |
36 | |
37 % END | |
38 |