comparison m-toolbox/html_help/help/ug/sigproc_lcohere_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 <h2>Description</h2>
2 <p>
3 The LTPDA method <a href="matlab:doc('ao/lcohere')">ao/lcohere</a> estimates the coherence function of time-series
4 signals, included in the input <tt>ao</tt>s following the LPSD algorithm <a href="#references">[1]</a>. Spectral density estimates are not
5 evaluated at frequencies which are linear multiples of the minimum frequency resolution <tt>1/T</tt>, where <tt>T</tt>
6 is the window lenght, but on a logarithmic scale. The algorithm takes care of calculating the frequencies at which to evaluate
7 the spectral estimate, aiming at minimizing the uncertainty in the estimate itself, and to recalculate a suitable
8 window length for each frequency bin.
9 </p>
10 <p>
11 Data are windowed prior to the estimation of the spectrum, by multiplying
12 it with a <a href="specwin.html">spectral window object</a>, and can be detrended by polinomial of time in order to reduce the impact
13 of the border discontinuities. Detrending is performed on each individual window.
14 The user can choose the quantity being given in output among ASD (amplitude spectral density),
15 PSD (power spectral density), AS (amplitude spectrum), and PS (power spectrum).
16 </p>
17 <br>
18 <h2>Syntax</h2>
19 </p>
20 <div class="fragment"><pre>
21 <br> b = lcohere(a1,a2,pl)
22 </pre>
23 </div>
24 <p> <tt>a1</tt> and <tt>a2</tt> are the 2 <tt>ao</tt>s containing the input time series to be evaluated, <tt>b</tt> is the output object and <tt>pl</tt> is an optional parameter list.
25
26 <h2>Parameters</h2>
27 <p>The parameter list <tt>pl</tt> includes the following parameters:</p>
28 <ul>
29 <li> <tt>'Kdes'</tt> - desired number of averages [default: 100]</li>
30 <li> <tt>'Jdes'</tt> - number of spectral frequencies to compute [default: 1000]</li>
31 <li> <tt>'Lmin'</tt> - minimum segment length [default: 0]</li>
32 <li> <tt>'Win'</tt> - the window to be applied to the data to remove the
33 discontinuities at edges of segments. [default: taken from user prefs].<br>
34 The window is described by a string with its name and, only in the case of Kaiser window,
35 the additional parameter <tt>'psll'</tt>. <br>For instance: plist('Win', 'Kaiser', 'psll', 200). </li>
36 <li> <tt>'Olap'</tt> - segment percent overlap [default: -1, (taken from window function)] </li>
37 <li> <tt>'Order'</tt> - order of segment detrending <ul>
38 <li> -1 - no detrending </li>
39 <li> 0 - subtract mean [default] </li>
40 <li> 1 - subtract linear fit </li>
41 <li> N - subtract fit of polynomial, order N </li> </ul> </li>
42 <li><tt>'Type'</tt> - type of scaling of the coherence function. Choose between:</li>
43 <ul>
44 <li> <tt>'C'</tt> - Complex Coherence Sxy / sqrt(Sxx * Syy) [default ]</li>
45 <li> <tt>'MS'</tt> - Magnitude-Squared Coherence (abs(Sxy))^2 / (Sxx * Syy) </li>
46 </ul>
47 </ul>
48 The length of the window is set by the value of the parameter <tt>'Nfft'</tt>, so that the window
49 is actually rebuilt using only the key features of the window, i.e. the name and, for Kaiser windows, the PSLL.
50 </p>
51 <p>
52 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
53 <tr width="90%">
54 <td>
55 If the user doesn't specify the value of a given parameter, the default value is used.
56 </td>
57 </tr>
58 </table>
59 </p>
60 <p>
61 The function makes magnitude-squadred coherence estimates between the 2 input <tt>ao</tt>s, on a logaritmic frequency scale.
62 If passing two identical objects <tt>ai</tt> or linearly combined signals, the output will be 1 at all frequencies.</p>
63 </pre> </div>
64 </p>
65 <h2>Algorithm</h2>
66 <p>
67 The algorithm is implemented according to <a href="#references">[1]</a>. The standard deviation of the mean is computed according to <a href="#references">[2]</a>:
68 </p>
69 <div align="center">
70 <img src="images/cohere_sigma1.png" >
71 </div>
72 where
73 <div align="center">
74 <img src="images/tfe_sigma2.png" >
75 </div>
76 <br>
77 <p>
78 is the coherence function.
79 In the LPSD algorithm, the first frequencies bins are usually computed using a single segment containing all the data.
80 For these bins, the sample variance is set to <tt>Inf</tt>.
81 </p>
82 <h2>Example</h2>
83 <p>
84 Evaluation of the coherence of two time-series represented by: a low frequency sinewave signal superimposed to
85 white noise, and a low frequency sinewave signal at the same frequency, phase shifted and with different
86 amplitude, superimposed to white noise.
87 </p>
88 <div class="fragment"><pre>
89 <br> <span class="comment">% Parameters</span>
90 nsecs = 1000;
91 fs = 10;
92 x = ao(plist(<span class="string">'waveform'</span>,<span class="string">'sine wave'</span>,<span class="string">'f'</span>,0.1,<span class="string">'A'</span>,1,<span class="string">'nsecs'</span>,nsecs,<span class="string">'fs'</span>,fs)) + ...
93 ao(plist(<span class="string">'waveform'</span>,<span class="string">'noise'</span>,<span class="string">'type'</span>,<span class="string">'normal'</span>,<span class="string">'nsecs'</span>,nsecs,<span class="string">'fs'</span>,fs));
94 x.setYunits(<span class="string">'m'</span>);
95 y = ao(plist(<span class="string">'waveform'</span>,<span class="string">'sine wave'</span>,<span class="string">'f'</span>,0.1,<span class="string">'A'</span>,2,<span class="string">'nsecs'</span>,nsecs,<span class="string">'fs'</span>,fs,<span class="string">'phi'</span>,90)) + ...
96 4*ao(plist(<span class="string">'waveform'</span>,<span class="string">'noise'</span>,<span class="string">'type'</span>,<span class="string">'normal'</span>,<span class="string">'nsecs'</span>,nsecs,<span class="string">'fs'</span>,fs));
97 y.setYunits(<span class="string">'V'</span>);
98
99 <span class="comment">% Compute log coherence</span>
100 Cxy = lcohere(x,y,plist(<span class="string">'win'</span>,<span class="string">'Kaiser'</span>,<span class="string">'psll'</span>,200));
101
102 <span class="comment">% Plot</span>
103 iplot(Cxy);
104 </pre>
105 </div>
106
107 <img src="images/l_cohere_1.png" alt="" border="3">
108 <br>
109 <!-- <img src="images/l_cohere_2.png" alt="" border="3">
110 <br> -->
111
112 <h2><a name="references">References</a></h2>
113
114 <ol>
115 <li> M. Troebs, G. Heinzel, Improved spectrum estimation from digitized time series
116 on a logarithmic frequency axis, <a href="http://dx.doi.org/10.1016/j.measurement.2005.10.010" ><i>Measurement</i>, Vol. 39 (2006), pp. 120 - 129</a>. See also the <a href="http://dx.doi.org/10.1016/j.measurement.2008.04.004" >Corrigendum</a>.</li>
117 <li> G.C. Carter, C.H. Knapp, A.H. Nuttall, Estimation of the Magnitude-Squared Coherence Function Via Overlapped Fast Fourier Transform Processing
118 , <i>IEEE Trans. on Audio and Electroacoustics</i>, Vol. 21, No. 4 (1973), pp. 337 - 344.</a></li>
119 </ol>