view m-toolbox/html_help/help/ug/ltpda_training_topic_2_3.html @ 25:79dc7091dbbc database-connection-manager

Update tests
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

<html lang="en">
<head>
  <meta name="generator" content=
  "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii">

  <title>Resampling a time-series AO (LTPDA Toolbox)</title>
  <link rel="stylesheet" href="docstyle.css" type="text/css">
  <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
  <meta name="description" content=
  "Presents an overview of the features, system requirements, and starting the toolbox.">
  </head>

<body>
  <a name="top_of_page" id="top_of_page"></a>

  <p style="font-size:1px;">&nbsp;</p>

  <table class="nav" summary="Navigation aid" border="0" width=
  "100%" cellpadding="0" cellspacing="0">
    <tr>
      <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>

      <td valign="baseline" align="right"><a href=
      "ltpda_training_topic_2_2.html"><img src="b_prev.gif" border="0" align=
      "bottom" alt="Upsampling a time-series AO"></a>&nbsp;&nbsp;&nbsp;<a href=
      "ltpda_training_topic_2_4.html"><img src="b_next.gif" border="0" align=
      "bottom" alt="Interpolation of a time-series AO"></a></td>
    </tr>
  </table>

  <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Resampling a time-series AO</h1>
  <hr>
  
  <p>
	<p>
  Resampling is the process of changing the sampling rate of data. The method <tt>ao/resample</tt></a>
  changes the sampling rate of the input AOs to the desired output sampling frequency by performing band-limited
  interpolation, or interpolation.
</p>
<p>
  If the ratio of the input and the desired output sample rate can be expressed as an integer ratio P/Q where both
  P and Q then band-limited interpolation can be performed. In this case, the data-series
  is upsampled (by inserting zeros) and then a low-pass filter is applied at the
  original Nyquist frequency.
</p>
<p>
   The <tt>ao/resample</tt></a> method can be called with the syntax:
</p>
<div class="fragment"><pre>
    b = resample(a, pl)
  </pre>
</div>
<p>
  and can accept the following parameters:
  <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
    <colgroup>
      <col width="25%"/>
      <col width="75%"/>
    </colgroup>
    <thead>
      <tr valign="top">
        <th class="categorylist">Key</th>
        <th class="categorylist">Description</th>
      </tr>
    </thead>
    <tbody>
      <!-- Key 'N' -->
      <tr valign="top">
        <td bgcolor="#f3f4f5">
          <p><tt>FSOUT</tt></p>
        </td>
        <td bgcolor="#f3f4f5">
          <p>The desired output frequency (must be positive and integer)</p>
        </td>
      </tr>
      <!-- Key 'FILTER' -->
      <tr valign="top">
        <td bgcolor="#f3f4f5">
          <p><tt>FILTER</tt></p>
        </td>
        <td bgcolor="#f3f4f5">
          <p>The filter to apply in the resampling process</p>
        </td>
      </tr>
    </tbody>
  </table>
</p>
<h2>Example 1</h2>
<p>
  Here we will resample a sequence of random data from the original sampling rate of 1 Hz to
  an output sampling of 50 Hz.
</p>
<div class="fragment"><pre>
    pl    = plist(<span class="string">'name'</span>, <span class="string">'None'</span>, <span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'nsecs'</span>,100,<span class="string">'fs'</span>,1,<span class="string">'yunits'</span>,<span class="string">'m'</span>);
    x     = ao(pl)
    pl_re = plist(<span class="string">'fsout'</span>, 50);
    x_re  = resample(x, pl_re); <span class="comment">% resample the input AO (x) to obtain the resampled output AO (y)</span>
    iplot(x, x_re, plist(<span class="string">'XRanges'</span>, [10 20], ...
                         <span class="string">'Markers'</span>, {<span class="string">'o'</span>, <span class="string">'.'</span>}, ...
                         <span class="string">'LineStyles'</span>, {<span class="string">'-'</span>, <span class="string">'none'</span>})) <span class="comment">% plot original and resampled data</span>
  </pre>
</div>

<img src="images/ltpda_training_1/topic2/re1.png" alt="Resample" border="3">





  </p>

  <br>
  <br>
  <table class="nav" summary="Navigation aid" border="0" width=
  "100%" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td align="left" width="20"><a href="ltpda_training_topic_2_2.html"><img src=
      "b_prev.gif" border="0" align="bottom" alt=
      "Upsampling a time-series AO"></a>&nbsp;</td>

      <td align="left">Upsampling a time-series AO</td>

      <td>&nbsp;</td>

      <td align="right">Interpolation of a time-series AO</td>

      <td align="right" width="20"><a href=
      "ltpda_training_topic_2_4.html"><img src="b_next.gif" border="0" align=
      "bottom" alt="Interpolation of a time-series AO"></a></td>
    </tr>
  </table><br>

  <p class="copy">&copy;LTP Team</p>
</body>
</html>