n class="p">]</span>
    <span class="c1"># converts array of time data points to appropriate frequency range and removes first term</span>

    <span class="n">yf</span> <span class="o">=</span> <span class="n">fft</span><span class="p">(</span><span class="n">ts</span><span class="p">)</span>  <span class="c1"># computes fast fourier transform on time series</span>
    <span class="c1"># converts fourier transform to spectral density scale</span>
    <span class="n">yf</span> <span class="o">=</span> <spa