Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/ng1D_content.html @ 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 | |
2 <p> | |
3 <ul> | |
4 <li><a href="#description">Description</a></li> | |
5 <li><a href="#call">Call</a></li> | |
6 <li><a href="#inputs">Inputs</a></li> | |
7 <li><a href="#outputs">Outputs</a></li> | |
8 <li><a href="#algorithm">Algorithm</a></li> | |
9 <li><a href="#parameters">Parameters</a></li> | |
10 <li><a href="#example">Example</a></li> | |
11 </ul> | |
12 </p> | |
13 | |
14 <h2><a name="description">Description</a></h2> | |
15 | |
16 <p> | |
17 noisegen1D is a coloring tool allowing the generation of colored noise from withe noise with a given spectrum. | |
18 The function constructs a coloring filter through a fitting procedure to the model provided. | |
19 If no model is provided an error is prompted. The colored noise provided has one-sided psd | |
20 corresponding to the input model. | |
21 </p> | |
22 | |
23 <h2><a name="call">Call</a></h2> | |
24 <div class="fragment"> | |
25 <pre> | |
26 b = noisegen1D(a, pl); | |
27 [b1,b2,...,bn] = noisegen1D(a1,a2,...,an, pl); | |
28 </pre> | |
29 </div> | |
30 | |
31 <h2><a name="inputs">Inputs</a></h2> | |
32 | |
33 <p> | |
34 <ul> | |
35 <li> a - is a tsdata analysis object or a vector of tsdata analysis objects | |
36 <li> pl - is a plist with the input parameters. See the list of function parameters below | |
37 </ul> | |
38 </p> | |
39 | |
40 <h2><a name="outputs">Outputs</a></h2> | |
41 | |
42 <p> | |
43 <ul> | |
44 <li> b - Colored time-series AOs. The coloring filters used | |
45 are stored in the objects procinfo field under the | |
46 parameter 'Filt'. | |
47 </ul> | |
48 </p> | |
49 | |
50 <h2><a name="algorithm">Algorithm</a></h2> | |
51 | |
52 <p> | |
53 <ol> | |
54 <li> Fit a set of partial fraction z-domain filters using utils.math.psd2tf. | |
55 <li> Convert to array of MIIR filters. | |
56 <li> Filter time-series in parallel. | |
57 </ol> | |
58 </p> | |
59 | |
60 <h2><a name="parameters">Parameters</a></h2> | |
61 <p> | |
62 <ul> | |
63 <li> 'Model' - a frequency-series AO describing the model psd. | |
64 <li> 'MaxIter' - Maximum number of iterations in fit routine | |
65 [default: 30] | |
66 <li> 'PoleType' - Choose the pole type for fitting: | |
67 <ul> | |
68 <li> 1 - use real starting poles. | |
69 <li> 2 - generates complex conjugate poles of the | |
70 type a.*exp(theta*pi*j) | |
71 with theta = linspace(0,pi,N/2+1). | |
72 <li> 3 - generates complex conjugate poles of the type | |
73 a.*exp(theta*pi*j) | |
74 with theta = linspace(0,pi,N/2+2) [default]. | |
75 </ul> | |
76 </li> | |
77 <li> 'MinOrder' - Minimum order to fit with. [default: 2]. | |
78 <li> 'MaxOrder' - Maximum order to fit with. [default: 25] | |
79 <li> 'Weights' - choose weighting for the fit: [default: 2] | |
80 <ul> | |
81 <li> 1 - equal weights for each point. | |
82 <li> 2 - weight with 1/abs(model). | |
83 <li> 3 - weight with 1/abs(model).^2. | |
84 <li> 4 - weight with inverse of the square mean spread of the model. | |
85 </ul> | |
86 </li> | |
87 <li> 'Plot' - plot results of each fitting step. [default: false] | |
88 <li> 'Disp' - Display the progress of the fitting iteration. | |
89 [default: false] | |
90 <li> 'FitTolerance' - Log Residuals difference - Check if the minimum | |
91 of the logarithmic difference between data and | |
92 residuals is larger than a specified value. | |
93 ie. if the conditioning value is 2, the | |
94 function ensures that the difference between | |
95 data and residuals is at lest 2 order of | |
96 magnitude lower than data itsleves. [Default: 2]. | |
97 <li> 'RMSEVar' - Root Mean Squared Error Variation - Check if the | |
98 variation of the RMS error is smaller than 10^(-b), | |
99 where b is the value given to the variable. This | |
100 option is useful for finding the minimum of Chi | |
101 squared. [default: 7]. | |
102 </ul> | |
103 </p> | |
104 | |
105 <h2><a name="example">Example</a></h2> | |
106 | |
107 <div class="fragment"> | |
108 <pre> | |
109 %% Noise generation from fsdata model object %%%%%%%%%%%%%%%%%%%%%%%%%%% | |
110 | |
111 % Description: | |
112 % 1) Generate a fsdata object to be used as psd model | |
113 % 2) Generate a random series of data (white) | |
114 % 3) Generate colored noise with noisegen1D | |
115 % 4) calculated psd of generated data | |
116 % 5) check result by plotting | |
117 | |
118 % 1) | |
119 fs = 10; % sampling frequency | |
120 pl_mod1 = plist('fsfcn', '0.01./(0.01+f)', 'f1', 1e-6, 'f2', 5, 'nf', 100); | |
121 mod1 = ao(pl_mod1); % fsdata model object | |
122 | |
123 % 2) | |
124 % generating white noise | |
125 a1 = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', 1000)); | |
126 | |
127 % 3) Noise generation | |
128 | |
129 pl1 = plist(... | |
130 'model', mod1, ... | |
131 'MaxIter', 30, ... | |
132 'PoleType', 2, ... | |
133 'MinOrder', 10, ... | |
134 'MaxOrder', 20, ... | |
135 'Weights', 2, ... | |
136 'Plot', false,... | |
137 'Disp', false,... | |
138 'RMSEVar', 5,... | |
139 'FitTolerance', 2); | |
140 | |
141 ac1 = noisegen1D(a1, pl1); | |
142 | |
143 % 4) | |
144 acxx1 = ac1.psd; | |
145 % 5) | |
146 iplot(acxx1, mod1); | |
147 </pre> | |
148 </div> | |
149 | |
150 <p> | |
151 <div align="center"> | |
152 <IMG src="images/ng1D_1.png" width="800" height="600" align="center" border="0"> | |
153 </div> | |
154 </p> | |
155 | |
156 | |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | |
165 |