[353] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 3 | <title>mixpp: Miscellaneous SP Functions</title> |
---|
| 4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
| 5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
| 7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
| 8 | <script type="text/javascript"> |
---|
| 9 | <!-- |
---|
| 10 | function changeDisplayState (e){ |
---|
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 12 | var button=this.firstChild; |
---|
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 15 | sectionDiv.style.display='block'; |
---|
| 16 | button.src='open.gif'; |
---|
| 17 | }else{ |
---|
| 18 | sectionDiv.style.display='none'; |
---|
| 19 | button.src='closed.gif'; |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | function initDynSections(){ |
---|
| 23 | var divs=document.getElementsByTagName('div'); |
---|
| 24 | var sectionCounter=1; |
---|
| 25 | for(var i=0;i<divs.length-1;i++){ |
---|
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 27 | var header=divs[i]; |
---|
| 28 | var section=divs[i+1]; |
---|
| 29 | var button=header.firstChild; |
---|
| 30 | if (button!='IMG'){ |
---|
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 32 | button=document.createElement('img'); |
---|
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 34 | } |
---|
| 35 | header.style.cursor='pointer'; |
---|
| 36 | header.onclick=changeDisplayState; |
---|
| 37 | header.id='dynheader'+sectionCounter; |
---|
| 38 | button.src='closed.gif'; |
---|
| 39 | section.id='dynsection'+sectionCounter; |
---|
| 40 | section.style.display='none'; |
---|
| 41 | section.style.marginLeft='14px'; |
---|
| 42 | sectionCounter++; |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | window.onload = initDynSections; |
---|
| 47 | --> |
---|
| 48 | </script> |
---|
| 49 | <div class="navigation" id="top"> |
---|
| 50 | <div class="tabs"> |
---|
| 51 | <ul> |
---|
| 52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
| 53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
| 55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
| 56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 57 | </ul> |
---|
| 58 | </div> |
---|
| 59 | </div> |
---|
| 60 | <div class="contents"> |
---|
| 61 | <h1>Miscellaneous SP Functions<br> |
---|
| 62 | <small> |
---|
| 63 | [<a class="el" href="group__signal.html">Signal Processing (SP) Module</a>]</small> |
---|
| 64 | </h1><table border="0" cellpadding="0" cellspacing="0"> |
---|
| 65 | <tr><td></td></tr> |
---|
| 66 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
---|
| 67 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g9892728c9821cd23e054947d25cd53b7">itpp::xcorr</a> (const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &y, const int max_lag=-1, const std::string scaleopt="none")</td></tr> |
---|
| 68 | |
---|
| 69 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cross Correlation. <a href="#g9892728c9821cd23e054947d25cd53b7"></a><br></td></tr> |
---|
| 70 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g05bea498eb6e95267115bbb475cd941d">itpp::xcorr</a> (const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &x, const int max_lag=-1, const std::string scaleopt="none")</td></tr> |
---|
| 71 | |
---|
| 72 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cross Correlation. <a href="#g05bea498eb6e95267115bbb475cd941d"></a><br></td></tr> |
---|
| 73 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g8642d544e6349c4d1dbcb27cd854d988">itpp::xcorr</a> (const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &y, <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> &out, const int max_lag=-1, const std::string scaleopt="none", bool autoflag=true)</td></tr> |
---|
| 74 | |
---|
| 75 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cross Correlation. <a href="#g8642d544e6349c4d1dbcb27cd854d988"></a><br></td></tr> |
---|
| 76 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Mat.html#6bba394f181c76fda12759568986c613">mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g1337b4e0a3946b967572f05e8f8a64a9">itpp::cov</a> (const <a class="el" href="classitpp_1_1Mat.html#6bba394f181c76fda12759568986c613">mat</a> &X, bool is_zero_mean=false)</td></tr> |
---|
| 77 | |
---|
| 78 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Covariance matrix calculation. <a href="#g1337b4e0a3946b967572f05e8f8a64a9"></a><br></td></tr> |
---|
| 79 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g771b5d7ed5b5e0d5ff283a2b360a2b94">itpp::spectrum</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &v, int nfft=256, int noverlap=0)</td></tr> |
---|
| 80 | |
---|
| 81 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Power spectrum calculation. <a href="#g771b5d7ed5b5e0d5ff283a2b360a2b94"></a><br></td></tr> |
---|
| 82 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g24804e1227fb135d6117652a417b44c0">itpp::spectrum</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &v, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &w, int noverlap=0)</td></tr> |
---|
| 83 | |
---|
| 84 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Power spectrum calculation. <a href="#g24804e1227fb135d6117652a417b44c0"></a><br></td></tr> |
---|
| 85 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#gf90f15e8bf19424c1445d9a95970f1a2">itpp::filter_spectrum</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &a, int nfft=256)</td></tr> |
---|
| 86 | |
---|
| 87 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Power spectrum calculation of a filter. <a href="#gf90f15e8bf19424c1445d9a95970f1a2"></a><br></td></tr> |
---|
| 88 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g24b2eabb9969e7ca90b75757bf239868">itpp::filter_spectrum</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &a, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &b, int nfft=256)</td></tr> |
---|
| 89 | |
---|
| 90 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Power spectrum calculation of a filter. <a href="#g24b2eabb9969e7ca90b75757bf239868"></a><br></td></tr> |
---|
| 91 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#g0b2356993f9e980f0fb2a26e06fcb1e4">itpp::xcorr_old</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &y, <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &out, const int max_lag=-1, const std::string scaleopt="none")</td></tr> |
---|
| 92 | |
---|
| 93 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cross-correlation calculation. <a href="#g0b2356993f9e980f0fb2a26e06fcb1e4"></a><br></td></tr> |
---|
| 94 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1f99701e2b0eba376159faf1fe954c88"></a><!-- doxytag: member="sigproc::xcorr" ref="g1f99701e2b0eba376159faf1fe954c88" args="(const vec &x, const vec &y, vec &out, const int max_lag, const std::string scaleopt)" --> |
---|
| 95 | void </td><td class="memItemRight" valign="bottom"><b>itpp::xcorr</b> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &y, <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &out, const int max_lag, const std::string scaleopt)</td></tr> |
---|
| 96 | |
---|
| 97 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#ge54c6432788931199ec028848c30accc">itpp::xcorr_old</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &y, const int max_lag=-1, const std::string scaleopt="none")</td></tr> |
---|
| 98 | |
---|
| 99 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cross-correlation calculation. <a href="#ge54c6432788931199ec028848c30accc"></a><br></td></tr> |
---|
| 100 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd62951ec0b8111086d95e87cffc61673"></a><!-- doxytag: member="sigproc::xcorr" ref="gd62951ec0b8111086d95e87cffc61673" args="(const vec &x, const vec &y, const int max_lag, const std::string scaleopt)" --> |
---|
| 101 | <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><b>itpp::xcorr</b> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &y, const int max_lag, const std::string scaleopt)</td></tr> |
---|
| 102 | |
---|
| 103 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sigproc.html#gc55897f3d77e7b9dba90d5c738c027e2">itpp::xcorr_old</a> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const int max_lag=-1, const std::string scaleopt="none")</td></tr> |
---|
| 104 | |
---|
| 105 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Auto-correlation calculation. <a href="#gc55897f3d77e7b9dba90d5c738c027e2"></a><br></td></tr> |
---|
| 106 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g344118b70e6d7b1d5f4728d8ba261f96"></a><!-- doxytag: member="sigproc::xcorr" ref="g344118b70e6d7b1d5f4728d8ba261f96" args="(const vec &x, const int max_lag, const std::string scaleopt)" --> |
---|
| 107 | <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> </td><td class="memItemRight" valign="bottom"><b>itpp::xcorr</b> (const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> &x, const int max_lag, const std::string scaleopt)</td></tr> |
---|
| 108 | |
---|
| 109 | </table> |
---|
| 110 | <hr><h2>Function Documentation</h2> |
---|
| 111 | <a class="anchor" name="g1337b4e0a3946b967572f05e8f8a64a9"></a><!-- doxytag: member="itpp::cov" ref="g1337b4e0a3946b967572f05e8f8a64a9" args="(const mat &X, bool is_zero_mean=false)" --> |
---|
| 112 | <div class="memitem"> |
---|
| 113 | <div class="memproto"> |
---|
| 114 | <table class="memname"> |
---|
| 115 | <tr> |
---|
| 116 | <td class="memname"><a class="el" href="classitpp_1_1Mat.html#6bba394f181c76fda12759568986c613">mat</a> itpp::cov </td> |
---|
| 117 | <td>(</td> |
---|
| 118 | <td class="paramtype">const <a class="el" href="classitpp_1_1Mat.html#6bba394f181c76fda12759568986c613">mat</a> & </td> |
---|
| 119 | <td class="paramname"> <em>X</em>, </td> |
---|
| 120 | </tr> |
---|
| 121 | <tr> |
---|
| 122 | <td class="paramkey"></td> |
---|
| 123 | <td></td> |
---|
| 124 | <td class="paramtype">bool </td> |
---|
| 125 | <td class="paramname"> <em>is_zero_mean</em> = <code>false</code></td><td> </td> |
---|
| 126 | </tr> |
---|
| 127 | <tr> |
---|
| 128 | <td></td> |
---|
| 129 | <td>)</td> |
---|
| 130 | <td></td><td></td><td></td> |
---|
| 131 | </tr> |
---|
| 132 | </table> |
---|
| 133 | </div> |
---|
| 134 | <div class="memdoc"> |
---|
| 135 | |
---|
| 136 | <p> |
---|
| 137 | Covariance matrix calculation. |
---|
| 138 | <p> |
---|
| 139 | Calculates the covariance matrix of the observations in the matrix <img class="formulaInl" alt="$X$" src="form_356.png">. Each row is an observation and each column represents a variable.<p> |
---|
| 140 | The covariance is normalized with the number of observations <img class="formulaInl" alt="$N$" src="form_357.png">. The mean value is removed before calculation.<p> |
---|
| 141 | Set is_zero_mean if X already has zero mean. |
---|
| 142 | <p>References <a class="el" href="misc__stat_8cpp-source.html#l00071">itpp::mean()</a>.</p> |
---|
| 143 | |
---|
| 144 | </div> |
---|
| 145 | </div><p> |
---|
| 146 | <a class="anchor" name="g24b2eabb9969e7ca90b75757bf239868"></a><!-- doxytag: member="itpp::filter_spectrum" ref="g24b2eabb9969e7ca90b75757bf239868" args="(const vec &a, const vec &b, int nfft=256)" --> |
---|
| 147 | <div class="memitem"> |
---|
| 148 | <div class="memproto"> |
---|
| 149 | <table class="memname"> |
---|
| 150 | <tr> |
---|
| 151 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::filter_spectrum </td> |
---|
| 152 | <td>(</td> |
---|
| 153 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 154 | <td class="paramname"> <em>a</em>, </td> |
---|
| 155 | </tr> |
---|
| 156 | <tr> |
---|
| 157 | <td class="paramkey"></td> |
---|
| 158 | <td></td> |
---|
| 159 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 160 | <td class="paramname"> <em>b</em>, </td> |
---|
| 161 | </tr> |
---|
| 162 | <tr> |
---|
| 163 | <td class="paramkey"></td> |
---|
| 164 | <td></td> |
---|
| 165 | <td class="paramtype">int </td> |
---|
| 166 | <td class="paramname"> <em>nfft</em> = <code>256</code></td><td> </td> |
---|
| 167 | </tr> |
---|
| 168 | <tr> |
---|
| 169 | <td></td> |
---|
| 170 | <td>)</td> |
---|
| 171 | <td></td><td></td><td></td> |
---|
| 172 | </tr> |
---|
| 173 | </table> |
---|
| 174 | </div> |
---|
| 175 | <div class="memdoc"> |
---|
| 176 | |
---|
| 177 | <p> |
---|
| 178 | Power spectrum calculation of a filter. |
---|
| 179 | <p> |
---|
| 180 | Calculates the power spectrum of a filter with transfer function a(z)/b(z) |
---|
| 181 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, <a class="el" href="group__fft.html#g47b556fc383bceb3cc562045acfa9f00">itpp::fft()</a>, <a class="el" href="elem__math_8h-source.html#l00056">itpp::sqr()</a>, and <a class="el" href="fix__functions_8cpp-source.html#l00045">itpp::to_cvec()</a>.</p> |
---|
| 182 | |
---|
| 183 | </div> |
---|
| 184 | </div><p> |
---|
| 185 | <a class="anchor" name="gf90f15e8bf19424c1445d9a95970f1a2"></a><!-- doxytag: member="itpp::filter_spectrum" ref="gf90f15e8bf19424c1445d9a95970f1a2" args="(const vec &a, int nfft=256)" --> |
---|
| 186 | <div class="memitem"> |
---|
| 187 | <div class="memproto"> |
---|
| 188 | <table class="memname"> |
---|
| 189 | <tr> |
---|
| 190 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::filter_spectrum </td> |
---|
| 191 | <td>(</td> |
---|
| 192 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 193 | <td class="paramname"> <em>a</em>, </td> |
---|
| 194 | </tr> |
---|
| 195 | <tr> |
---|
| 196 | <td class="paramkey"></td> |
---|
| 197 | <td></td> |
---|
| 198 | <td class="paramtype">int </td> |
---|
| 199 | <td class="paramname"> <em>nfft</em> = <code>256</code></td><td> </td> |
---|
| 200 | </tr> |
---|
| 201 | <tr> |
---|
| 202 | <td></td> |
---|
| 203 | <td>)</td> |
---|
| 204 | <td></td><td></td><td></td> |
---|
| 205 | </tr> |
---|
| 206 | </table> |
---|
| 207 | </div> |
---|
| 208 | <div class="memdoc"> |
---|
| 209 | |
---|
| 210 | <p> |
---|
| 211 | Power spectrum calculation of a filter. |
---|
| 212 | <p> |
---|
| 213 | Calculates the power spectrum of a filter with transfer function a(z) |
---|
| 214 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, <a class="el" href="group__fft.html#g47b556fc383bceb3cc562045acfa9f00">itpp::fft()</a>, <a class="el" href="elem__math_8h-source.html#l00056">itpp::sqr()</a>, and <a class="el" href="fix__functions_8cpp-source.html#l00045">itpp::to_cvec()</a>.</p> |
---|
| 215 | |
---|
| 216 | </div> |
---|
| 217 | </div><p> |
---|
| 218 | <a class="anchor" name="g24804e1227fb135d6117652a417b44c0"></a><!-- doxytag: member="itpp::spectrum" ref="g24804e1227fb135d6117652a417b44c0" args="(const vec &v, const vec &w, int noverlap=0)" --> |
---|
| 219 | <div class="memitem"> |
---|
| 220 | <div class="memproto"> |
---|
| 221 | <table class="memname"> |
---|
| 222 | <tr> |
---|
| 223 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::spectrum </td> |
---|
| 224 | <td>(</td> |
---|
| 225 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 226 | <td class="paramname"> <em>v</em>, </td> |
---|
| 227 | </tr> |
---|
| 228 | <tr> |
---|
| 229 | <td class="paramkey"></td> |
---|
| 230 | <td></td> |
---|
| 231 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 232 | <td class="paramname"> <em>w</em>, </td> |
---|
| 233 | </tr> |
---|
| 234 | <tr> |
---|
| 235 | <td class="paramkey"></td> |
---|
| 236 | <td></td> |
---|
| 237 | <td class="paramtype">int </td> |
---|
| 238 | <td class="paramname"> <em>noverlap</em> = <code>0</code></td><td> </td> |
---|
| 239 | </tr> |
---|
| 240 | <tr> |
---|
| 241 | <td></td> |
---|
| 242 | <td>)</td> |
---|
| 243 | <td></td><td></td><td></td> |
---|
| 244 | </tr> |
---|
| 245 | </table> |
---|
| 246 | </div> |
---|
| 247 | <div class="memdoc"> |
---|
| 248 | |
---|
| 249 | <p> |
---|
| 250 | Power spectrum calculation. |
---|
| 251 | <p> |
---|
| 252 | Calculates the power spectrum using using the Welch method and the supplied window w. |
---|
| 253 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, <a class="el" href="misc__stat_8h-source.html#l00252">itpp::energy()</a>, <a class="el" href="group__fft.html#g47b556fc383bceb3cc562045acfa9f00">itpp::fft()</a>, <a class="el" href="itassert_8h-source.html#l00107">it_assert_debug</a>, <a class="el" href="log__exp_8h-source.html#l00303">itpp::levels2bits()</a>, <a class="el" href="log__exp_8h-source.html#l00053">itpp::pow2i()</a>, <a class="el" href="elem__math_8h-source.html#l00056">itpp::sqr()</a>, <a class="el" href="fix__functions_8cpp-source.html#l00045">itpp::to_cvec()</a>, and <a class="el" href="matfunc_8h-source.html#l00279">itpp::zero_pad()</a>.</p> |
---|
| 254 | |
---|
| 255 | <p>Referenced by <a class="el" href="punct__convcode_8cpp-source.html#l00734">itpp::Punctured_Convolutional_Code::calculate_spectrum()</a>, <a class="el" href="convcode_8cpp-source.html#l01214">itpp::Convolutional_Code::calculate_spectrum()</a>, <a class="el" href="punct__convcode_8cpp-source.html#l00589">itpp::Punctured_Convolutional_Code::fast()</a>, and <a class="el" href="convcode_8cpp-source.html#l01296">itpp::Convolutional_Code::fast()</a>.</p> |
---|
| 256 | |
---|
| 257 | </div> |
---|
| 258 | </div><p> |
---|
| 259 | <a class="anchor" name="g771b5d7ed5b5e0d5ff283a2b360a2b94"></a><!-- doxytag: member="itpp::spectrum" ref="g771b5d7ed5b5e0d5ff283a2b360a2b94" args="(const vec &v, int nfft=256, int noverlap=0)" --> |
---|
| 260 | <div class="memitem"> |
---|
| 261 | <div class="memproto"> |
---|
| 262 | <table class="memname"> |
---|
| 263 | <tr> |
---|
| 264 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::spectrum </td> |
---|
| 265 | <td>(</td> |
---|
| 266 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 267 | <td class="paramname"> <em>v</em>, </td> |
---|
| 268 | </tr> |
---|
| 269 | <tr> |
---|
| 270 | <td class="paramkey"></td> |
---|
| 271 | <td></td> |
---|
| 272 | <td class="paramtype">int </td> |
---|
| 273 | <td class="paramname"> <em>nfft</em> = <code>256</code>, </td> |
---|
| 274 | </tr> |
---|
| 275 | <tr> |
---|
| 276 | <td class="paramkey"></td> |
---|
| 277 | <td></td> |
---|
| 278 | <td class="paramtype">int </td> |
---|
| 279 | <td class="paramname"> <em>noverlap</em> = <code>0</code></td><td> </td> |
---|
| 280 | </tr> |
---|
| 281 | <tr> |
---|
| 282 | <td></td> |
---|
| 283 | <td>)</td> |
---|
| 284 | <td></td><td></td><td></td> |
---|
| 285 | </tr> |
---|
| 286 | </table> |
---|
| 287 | </div> |
---|
| 288 | <div class="memdoc"> |
---|
| 289 | |
---|
| 290 | <p> |
---|
| 291 | Power spectrum calculation. |
---|
| 292 | <p> |
---|
| 293 | Calculates the power spectrum using the Welch method and a Hanning window. |
---|
| 294 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, <a class="el" href="group__fft.html#g47b556fc383bceb3cc562045acfa9f00">itpp::fft()</a>, <a class="el" href="window_8cpp-source.html#l00056">itpp::hanning()</a>, <a class="el" href="itassert_8h-source.html#l00107">it_assert_debug</a>, <a class="el" href="log__exp_8h-source.html#l00303">itpp::levels2bits()</a>, <a class="el" href="log__exp_8h-source.html#l00053">itpp::pow2i()</a>, <a class="el" href="elem__math_8h-source.html#l00056">itpp::sqr()</a>, <a class="el" href="fix__functions_8cpp-source.html#l00045">itpp::to_cvec()</a>, and <a class="el" href="matfunc_8h-source.html#l00279">itpp::zero_pad()</a>.</p> |
---|
| 295 | |
---|
| 296 | </div> |
---|
| 297 | </div><p> |
---|
| 298 | <a class="anchor" name="g8642d544e6349c4d1dbcb27cd854d988"></a><!-- doxytag: member="itpp::xcorr" ref="g8642d544e6349c4d1dbcb27cd854d988" args="(const cvec &x, const cvec &y, cvec &out, const int max_lag=-1, const std::string scaleopt="none", bool autoflag=true)" --> |
---|
| 299 | <div class="memitem"> |
---|
| 300 | <div class="memproto"> |
---|
| 301 | <table class="memname"> |
---|
| 302 | <tr> |
---|
| 303 | <td class="memname">void itpp::xcorr </td> |
---|
| 304 | <td>(</td> |
---|
| 305 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 306 | <td class="paramname"> <em>x</em>, </td> |
---|
| 307 | </tr> |
---|
| 308 | <tr> |
---|
| 309 | <td class="paramkey"></td> |
---|
| 310 | <td></td> |
---|
| 311 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 312 | <td class="paramname"> <em>y</em>, </td> |
---|
| 313 | </tr> |
---|
| 314 | <tr> |
---|
| 315 | <td class="paramkey"></td> |
---|
| 316 | <td></td> |
---|
| 317 | <td class="paramtype"><a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 318 | <td class="paramname"> <em>out</em>, </td> |
---|
| 319 | </tr> |
---|
| 320 | <tr> |
---|
| 321 | <td class="paramkey"></td> |
---|
| 322 | <td></td> |
---|
| 323 | <td class="paramtype">const int </td> |
---|
| 324 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 325 | </tr> |
---|
| 326 | <tr> |
---|
| 327 | <td class="paramkey"></td> |
---|
| 328 | <td></td> |
---|
| 329 | <td class="paramtype">const std::string </td> |
---|
| 330 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code>, </td> |
---|
| 331 | </tr> |
---|
| 332 | <tr> |
---|
| 333 | <td class="paramkey"></td> |
---|
| 334 | <td></td> |
---|
| 335 | <td class="paramtype">bool </td> |
---|
| 336 | <td class="paramname"> <em>autoflag</em> = <code>true</code></td><td> </td> |
---|
| 337 | </tr> |
---|
| 338 | <tr> |
---|
| 339 | <td></td> |
---|
| 340 | <td>)</td> |
---|
| 341 | <td></td><td></td><td></td> |
---|
| 342 | </tr> |
---|
| 343 | </table> |
---|
| 344 | </div> |
---|
| 345 | <div class="memdoc"> |
---|
| 346 | |
---|
| 347 | <p> |
---|
| 348 | Cross Correlation. |
---|
| 349 | <p> |
---|
| 350 | <div class="fragment"><pre class="fragment"> xcorr(x,y,out) |
---|
| 351 | </pre></div> Computes the cross-correlatin and returns in vector <b>out</b> |
---|
| 352 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, <a class="el" href="group__convertfunc.html#g0f093b7797b4e80006219f0dee101ecf">itpp::ceil_i()</a>, <a class="el" href="fix__functions_8cpp-source.html#l00098">itpp::conj()</a>, <a class="el" href="group__fft.html#g47b556fc383bceb3cc562045acfa9f00">itpp::fft()</a>, <a class="el" href="group__fft.html#gda0d68d66e55693b98d6f5a374943593">itpp::ifft()</a>, <a class="el" href="itassert_8h-source.html#l00173">it_warning</a>, <a class="el" href="specmat_8cpp-source.html#l00114">itpp::linspace()</a>, <a class="el" href="log__exp_8h-source.html#l00247">itpp::log2()</a>, <a class="el" href="tcp_8h-source.html#l00117">itpp::max()</a>, <a class="el" href="log__exp_8h-source.html#l00053">itpp::pow2i()</a>, <a class="el" href="elem__math_8h-source.html#l00126">itpp::sqrt()</a>, <a class="el" href="matfunc_8h-source.html#l00077">itpp::sum()</a>, <a class="el" href="fix__functions_8cpp-source.html#l00045">itpp::to_cvec()</a>, and <a class="el" href="matfunc_8h-source.html#l00279">itpp::zero_pad()</a>.</p> |
---|
| 353 | |
---|
| 354 | <p>Referenced by <a class="el" href="sigfun_8cpp-source.html#l00057">itpp::xcorr()</a>.</p> |
---|
| 355 | |
---|
| 356 | </div> |
---|
| 357 | </div><p> |
---|
| 358 | <a class="anchor" name="g05bea498eb6e95267115bbb475cd941d"></a><!-- doxytag: member="itpp::xcorr" ref="g05bea498eb6e95267115bbb475cd941d" args="(const cvec &x, const int max_lag=-1, const std::string scaleopt="none")" --> |
---|
| 359 | <div class="memitem"> |
---|
| 360 | <div class="memproto"> |
---|
| 361 | <table class="memname"> |
---|
| 362 | <tr> |
---|
| 363 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> itpp::xcorr </td> |
---|
| 364 | <td>(</td> |
---|
| 365 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 366 | <td class="paramname"> <em>x</em>, </td> |
---|
| 367 | </tr> |
---|
| 368 | <tr> |
---|
| 369 | <td class="paramkey"></td> |
---|
| 370 | <td></td> |
---|
| 371 | <td class="paramtype">const int </td> |
---|
| 372 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 373 | </tr> |
---|
| 374 | <tr> |
---|
| 375 | <td class="paramkey"></td> |
---|
| 376 | <td></td> |
---|
| 377 | <td class="paramtype">const std::string </td> |
---|
| 378 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code></td><td> </td> |
---|
| 379 | </tr> |
---|
| 380 | <tr> |
---|
| 381 | <td></td> |
---|
| 382 | <td>)</td> |
---|
| 383 | <td></td><td></td><td></td> |
---|
| 384 | </tr> |
---|
| 385 | </table> |
---|
| 386 | </div> |
---|
| 387 | <div class="memdoc"> |
---|
| 388 | |
---|
| 389 | <p> |
---|
| 390 | Cross Correlation. |
---|
| 391 | <p> |
---|
| 392 | <div class="fragment"><pre class="fragment"> r = xcorr(x) |
---|
| 393 | </pre></div> returns the auto-correlation vecotr <b>r</b>. |
---|
| 394 | <p>References <a class="el" href="sigfun_8cpp-source.html#l00157">itpp::xcorr()</a>.</p> |
---|
| 395 | |
---|
| 396 | </div> |
---|
| 397 | </div><p> |
---|
| 398 | <a class="anchor" name="g9892728c9821cd23e054947d25cd53b7"></a><!-- doxytag: member="itpp::xcorr" ref="g9892728c9821cd23e054947d25cd53b7" args="(const cvec &x, const cvec &y, const int max_lag=-1, const std::string scaleopt="none")" --> |
---|
| 399 | <div class="memitem"> |
---|
| 400 | <div class="memproto"> |
---|
| 401 | <table class="memname"> |
---|
| 402 | <tr> |
---|
| 403 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> itpp::xcorr </td> |
---|
| 404 | <td>(</td> |
---|
| 405 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 406 | <td class="paramname"> <em>x</em>, </td> |
---|
| 407 | </tr> |
---|
| 408 | <tr> |
---|
| 409 | <td class="paramkey"></td> |
---|
| 410 | <td></td> |
---|
| 411 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#e83c1408740e41a7e29c383b71d4d544">cvec</a> & </td> |
---|
| 412 | <td class="paramname"> <em>y</em>, </td> |
---|
| 413 | </tr> |
---|
| 414 | <tr> |
---|
| 415 | <td class="paramkey"></td> |
---|
| 416 | <td></td> |
---|
| 417 | <td class="paramtype">const int </td> |
---|
| 418 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 419 | </tr> |
---|
| 420 | <tr> |
---|
| 421 | <td class="paramkey"></td> |
---|
| 422 | <td></td> |
---|
| 423 | <td class="paramtype">const std::string </td> |
---|
| 424 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code></td><td> </td> |
---|
| 425 | </tr> |
---|
| 426 | <tr> |
---|
| 427 | <td></td> |
---|
| 428 | <td>)</td> |
---|
| 429 | <td></td><td></td><td></td> |
---|
| 430 | </tr> |
---|
| 431 | </table> |
---|
| 432 | </div> |
---|
| 433 | <div class="memdoc"> |
---|
| 434 | |
---|
| 435 | <p> |
---|
| 436 | Cross Correlation. |
---|
| 437 | <p> |
---|
| 438 | <div class="fragment"><pre class="fragment"> r = xcorr(x,y) |
---|
| 439 | </pre></div> returns the cross-correlation vector <b>r</b>. |
---|
| 440 | <p>References <a class="el" href="sigfun_8cpp-source.html#l00157">itpp::xcorr()</a>.</p> |
---|
| 441 | |
---|
| 442 | </div> |
---|
| 443 | </div><p> |
---|
| 444 | <a class="anchor" name="gc55897f3d77e7b9dba90d5c738c027e2"></a><!-- doxytag: member="itpp::xcorr_old" ref="gc55897f3d77e7b9dba90d5c738c027e2" args="(const vec &x, const int max_lag=-1, const std::string scaleopt="none")" --> |
---|
| 445 | <div class="memitem"> |
---|
| 446 | <div class="memproto"> |
---|
| 447 | <table class="memname"> |
---|
| 448 | <tr> |
---|
| 449 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::xcorr_old </td> |
---|
| 450 | <td>(</td> |
---|
| 451 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 452 | <td class="paramname"> <em>x</em>, </td> |
---|
| 453 | </tr> |
---|
| 454 | <tr> |
---|
| 455 | <td class="paramkey"></td> |
---|
| 456 | <td></td> |
---|
| 457 | <td class="paramtype">const int </td> |
---|
| 458 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 459 | </tr> |
---|
| 460 | <tr> |
---|
| 461 | <td class="paramkey"></td> |
---|
| 462 | <td></td> |
---|
| 463 | <td class="paramtype">const std::string </td> |
---|
| 464 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code></td><td> </td> |
---|
| 465 | </tr> |
---|
| 466 | <tr> |
---|
| 467 | <td></td> |
---|
| 468 | <td>)</td> |
---|
| 469 | <td></td><td></td><td></td> |
---|
| 470 | </tr> |
---|
| 471 | </table> |
---|
| 472 | </div> |
---|
| 473 | <div class="memdoc"> |
---|
| 474 | |
---|
| 475 | <p> |
---|
| 476 | Auto-correlation calculation. |
---|
| 477 | <p> |
---|
| 478 | <code>z=xcorr</code>(x,max_lag), where <em>x</em> and is a length <em>M</em> vector <em></em>(M>1), returns the length <code>2*max_lag+1</code> auto-correlation sequence <em>z</em>. (lags: <code>-max_lag</code>,...,0,...,max_lag)<p> |
---|
| 479 | For <code>max_lag=-1</code> the auto-correlation sequence is of length <code>2*M-1</code>, i.e., the cross correlation for all possible lags.<p> |
---|
| 480 | Scaling options <em>scaleopt:</em> <ul> |
---|
| 481 | <li><em>none</em> <code>=></code> No scaling of the auto-correlation vector </li> |
---|
| 482 | <li><em>biased</em> <code>=></code> Scales the auto-correlation vector by <code>1/M</code> </li> |
---|
| 483 | <li><em>unbiased</em> <code>=></code> Scales the auto-correlation vector by <code>1/</code>(M-abs(lag)) </li> |
---|
| 484 | <li><em>coeff</em> <code>=></code> Normalises the auto-correlation so that <code>acf(x)=1</code> for zero lag.</li> |
---|
| 485 | </ul> |
---|
| 486 | <dl class="note" compact><dt><b>Note:</b></dt><dd><code>max_lag</code> <code><=</code> <code>M-1</code> </dd></dl> |
---|
| 487 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 488 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 489 | <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>(Input) Vector of samples </td></tr> |
---|
| 490 | <tr><td valign="top"></td><td valign="top"><em>max_lag</em> </td><td>(Input) Maximum lag for which the auto-correlation is calculated. The output vector is of size <code>2*maxlag+1</code>. Default value <code>max_lag=-1</code> calculates the auto-correlations for all possible lags. </td></tr> |
---|
| 491 | <tr><td valign="top"></td><td valign="top"><em>scaleopt</em> </td><td>(Input) Indicates how the auto-correlation function should be scaled. Default value: <code>"none"</code> indicates that no scaling is done. </td></tr> |
---|
| 492 | </table> |
---|
| 493 | </dl> |
---|
| 494 | <dl class="return" compact><dt><b>Returns:</b></dt><dd>The auto-correlation of <em>x</em>. </dd></dl> |
---|
| 495 | |
---|
| 496 | <p>References <a class="el" href="sigfun_8cpp-source.html#l00149">itpp::xcorr_old()</a>.</p> |
---|
| 497 | |
---|
| 498 | </div> |
---|
| 499 | </div><p> |
---|
| 500 | <a class="anchor" name="ge54c6432788931199ec028848c30accc"></a><!-- doxytag: member="itpp::xcorr_old" ref="ge54c6432788931199ec028848c30accc" args="(const vec &x, const vec &y, const int max_lag=-1, const std::string scaleopt="none")" --> |
---|
| 501 | <div class="memitem"> |
---|
| 502 | <div class="memproto"> |
---|
| 503 | <table class="memname"> |
---|
| 504 | <tr> |
---|
| 505 | <td class="memname"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> itpp::xcorr_old </td> |
---|
| 506 | <td>(</td> |
---|
| 507 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 508 | <td class="paramname"> <em>x</em>, </td> |
---|
| 509 | </tr> |
---|
| 510 | <tr> |
---|
| 511 | <td class="paramkey"></td> |
---|
| 512 | <td></td> |
---|
| 513 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 514 | <td class="paramname"> <em>y</em>, </td> |
---|
| 515 | </tr> |
---|
| 516 | <tr> |
---|
| 517 | <td class="paramkey"></td> |
---|
| 518 | <td></td> |
---|
| 519 | <td class="paramtype">const int </td> |
---|
| 520 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 521 | </tr> |
---|
| 522 | <tr> |
---|
| 523 | <td class="paramkey"></td> |
---|
| 524 | <td></td> |
---|
| 525 | <td class="paramtype">const std::string </td> |
---|
| 526 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code></td><td> </td> |
---|
| 527 | </tr> |
---|
| 528 | <tr> |
---|
| 529 | <td></td> |
---|
| 530 | <td>)</td> |
---|
| 531 | <td></td><td></td><td></td> |
---|
| 532 | </tr> |
---|
| 533 | </table> |
---|
| 534 | </div> |
---|
| 535 | <div class="memdoc"> |
---|
| 536 | |
---|
| 537 | <p> |
---|
| 538 | Cross-correlation calculation. |
---|
| 539 | <p> |
---|
| 540 | <code>z=xcorr</code>(x,y,max_lag), where <em>x</em> and <em>y</em> are length <em>M</em> vectors <em></em>(M>1), returns the length <code>2*max_lag+1</code> cross-correlation sequence <em>z</em>. (lags: <code>-max_lag</code>,...,0,...,max_lag)<p> |
---|
| 541 | For <code>max_lag=-1</code> the cross-correlation sequence is of length <code>2*M-1</code>, i.e., the cross-correlation for all possible lags.<p> |
---|
| 542 | Scaling options <em>scaleopt:</em> <ul> |
---|
| 543 | <li><em>none</em> <code>=></code> No scaling of the cross-correlation vector </li> |
---|
| 544 | <li><em>biased</em> <code>=></code> Scales the cross-correlation vector by <code>1/M</code> </li> |
---|
| 545 | <li><em>unbiased</em> <code>=></code> Scales the cross-correlation vector by <code>1/</code>(M-abs(lag)) </li> |
---|
| 546 | <li><em>coeff</em> <code>=></code> Normalises the cross-correlation to 1 for zero lag.</li> |
---|
| 547 | </ul> |
---|
| 548 | <dl class="note" compact><dt><b>Note:</b></dt><dd><code>max_lag</code> <code><=</code> <code>M-1</code> <p> |
---|
| 549 | If <code>x</code> and <code>y</code> are of different length, the shortest one is zero-padded</dd></dl> |
---|
| 550 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 551 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 552 | <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>(Input) Vector of samples </td></tr> |
---|
| 553 | <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>(Input) Vector of samples </td></tr> |
---|
| 554 | <tr><td valign="top"></td><td valign="top"><em>max_lag</em> </td><td>(Input) Maximum lag for which the cross-correlation is calculated. The output vector is of size <code>2*maxlag+1</code>. Default value: <code>max_lag=-1</code> calculates the cross-correlations for all possible lags </td></tr> |
---|
| 555 | <tr><td valign="top"></td><td valign="top"><em>scaleopt</em> </td><td>(Input) Indicates how the cross-correlation function should be scaled. Default value: <code>"none"</code> indicates that no scaling is done </td></tr> |
---|
| 556 | </table> |
---|
| 557 | </dl> |
---|
| 558 | <dl class="return" compact><dt><b>Returns:</b></dt><dd>The cross correlation between <em>x</em> and <em>y</em>. </dd></dl> |
---|
| 559 | |
---|
| 560 | <p>Referenced by <a class="el" href="sigfun_8cpp-source.html#l00042">itpp::xcorr_old()</a>.</p> |
---|
| 561 | |
---|
| 562 | </div> |
---|
| 563 | </div><p> |
---|
| 564 | <a class="anchor" name="g0b2356993f9e980f0fb2a26e06fcb1e4"></a><!-- doxytag: member="itpp::xcorr_old" ref="g0b2356993f9e980f0fb2a26e06fcb1e4" args="(const vec &x, const vec &y, vec &out, const int max_lag=-1, const std::string scaleopt="none")" --> |
---|
| 565 | <div class="memitem"> |
---|
| 566 | <div class="memproto"> |
---|
| 567 | <table class="memname"> |
---|
| 568 | <tr> |
---|
| 569 | <td class="memname">void itpp::xcorr_old </td> |
---|
| 570 | <td>(</td> |
---|
| 571 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 572 | <td class="paramname"> <em>x</em>, </td> |
---|
| 573 | </tr> |
---|
| 574 | <tr> |
---|
| 575 | <td class="paramkey"></td> |
---|
| 576 | <td></td> |
---|
| 577 | <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 578 | <td class="paramname"> <em>y</em>, </td> |
---|
| 579 | </tr> |
---|
| 580 | <tr> |
---|
| 581 | <td class="paramkey"></td> |
---|
| 582 | <td></td> |
---|
| 583 | <td class="paramtype"><a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> & </td> |
---|
| 584 | <td class="paramname"> <em>out</em>, </td> |
---|
| 585 | </tr> |
---|
| 586 | <tr> |
---|
| 587 | <td class="paramkey"></td> |
---|
| 588 | <td></td> |
---|
| 589 | <td class="paramtype">const int </td> |
---|
| 590 | <td class="paramname"> <em>max_lag</em> = <code>-1</code>, </td> |
---|
| 591 | </tr> |
---|
| 592 | <tr> |
---|
| 593 | <td class="paramkey"></td> |
---|
| 594 | <td></td> |
---|
| 595 | <td class="paramtype">const std::string </td> |
---|
| 596 | <td class="paramname"> <em>scaleopt</em> = <code>"none"</code></td><td> </td> |
---|
| 597 | </tr> |
---|
| 598 | <tr> |
---|
| 599 | <td></td> |
---|
| 600 | <td>)</td> |
---|
| 601 | <td></td><td></td><td></td> |
---|
| 602 | </tr> |
---|
| 603 | </table> |
---|
| 604 | </div> |
---|
| 605 | <div class="memdoc"> |
---|
| 606 | |
---|
| 607 | <p> |
---|
| 608 | Cross-correlation calculation. |
---|
| 609 | <p> |
---|
| 610 | <code>z=xcorr</code>(x,y,max_lag), where <em>x</em> and <em>y</em> are length <em>M</em> vectors <em></em>(M>1), returns the length <code>2*max_lag+1</code> cross-correlation sequence <em>z</em>. (lags: <code>-max_lag</code>,...,0,...,max_lag)<p> |
---|
| 611 | For <code>max_lag=-1</code> the cross-correlation sequence is of length <code>2*M-1</code>, i.e., the cross-correlation for all possible lags.<p> |
---|
| 612 | Scaling options <em>scaleopt:</em> <ul> |
---|
| 613 | <li><em>none</em> <code>=></code> No scaling of the cross-correlation vector </li> |
---|
| 614 | <li><em>biased</em> <code>=></code> Scales the cross-correlation vector by <code>1/M</code> </li> |
---|
| 615 | <li><em>unbiased</em> <code>=></code> Scales the cross-correlation vector by <code>1/</code>(M-abs(lag)) </li> |
---|
| 616 | <li><em>coeff</em> <code>=></code> Normalises the cross-correlation to 1 for zero lag.</li> |
---|
| 617 | </ul> |
---|
| 618 | <dl class="note" compact><dt><b>Note:</b></dt><dd><code>max_lag</code> <code><=</code> <code>M-1</code> <p> |
---|
| 619 | If <code>x</code> and <code>y</code> are of different length, the shortest one is zero-padded</dd></dl> |
---|
| 620 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 621 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 622 | <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>(Input) Vector of samples </td></tr> |
---|
| 623 | <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>(Input) Vector of samples </td></tr> |
---|
| 624 | <tr><td valign="top"></td><td valign="top"><em>out</em> </td><td>(Output) The cross correlation between <em>x</em> and <em>y</em>. </td></tr> |
---|
| 625 | <tr><td valign="top"></td><td valign="top"><em>max_lag</em> </td><td>(Input) Maximum lag for which the cross-correlation is calculated. The output vector is of size <code>2*maxlag+1</code>. Default value: <code>max_lag=-1</code> calculates the cross-correlations for all possible lags </td></tr> |
---|
| 626 | <tr><td valign="top"></td><td valign="top"><em>scaleopt</em> </td><td>(Input) Indicates how the cross-correlation function should be scaled. Default value: <code>"none"</code> indicates that no scaling is done </td></tr> |
---|
| 627 | </table> |
---|
| 628 | </dl> |
---|
| 629 | |
---|
| 630 | <p>References <a class="el" href="misc__stat_8h-source.html#l00252">itpp::energy()</a>, <a class="el" href="matfunc_8h-source.html#l00297">itpp::index_zero_pad()</a>, <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="itassert_8h-source.html#l00126">it_error</a>, <a class="el" href="tcp_8h-source.html#l00117">itpp::max()</a>, and <a class="el" href="elem__math_8h-source.html#l00126">itpp::sqrt()</a>.</p> |
---|
| 631 | |
---|
| 632 | </div> |
---|
| 633 | </div><p> |
---|
| 634 | </div> |
---|
| 635 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:14 2009 for mixpp by |
---|
| 636 | <a href="http://www.doxygen.org/index.html"> |
---|
| 637 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
| 638 | </body> |
---|
| 639 | </html> |
---|