comparison m-toolbox/test/test_noisegen.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 function test_noisegen()
2
3 % TEST_NOISEGEN tests the Franklin noise-generator algorithm.
4 %
5 %
6 % $Id: test_noisegen.m,v 1.11 2008/07/18 15:53:58 anneke Exp $
7 %
8
9
10
11 %% poles and zeros
12 pole = [pz(5,1) pz(1)];
13 zero = pz(3);
14 gain = 1;
15 pzm = pzmodel(gain, pole, zero);%% convert to get a and b coefficients
16
17 % parameter list for noise generation
18 pl = plist('nsecs', 100000,'fs', 10,'pzmodel', pzm, 'ndigits',50);
19
20 %% calling the noisegenerator
21 b = ao(pl);
22
23 %% Make LPSD
24 % Window function
25 w = specwin('Kaiser', 10, 150);
26 % parameter list for lpsd
27 lpl = plist('Kdes', 1000,'Kmin', 2,'Jdes', 1000,'Win', w,'order',0,'scale','ASD');
28
29 % LPSD
30 noise = lpsd(b, lpl); % matlab
31
32 rpl = plist('f1',1e-5,'f2',10,'nf',5e3);
33 %% Plot
34 % iplot(b)
35 % iplot(analyt)
36 plpl = plist('lengend','off');
37 iplot(noise,abs(resp(pzm,rpl)),plpl)
38
39 % plot(noise.hist)