</span>
    <span class="c1"># time series must be one dimensional array</span>
    <span class="n">fs</span> <span class="o">=</span> <span class="n">fs</span><span class="o">/</span><span class="mi">2</span>
    <span class="n">ts</span> <span class="o">=</span> <span class="n">ts</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">ts</span><span class="p">,))</span>
    <span class="n">t</span> <span class=