="n">mag_spec</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">spec</span><span class="p">)</span>

        <span class="c1"># harmonic-percussive separation</span>
        <span class="n">mag_spec_perc</span> <span class="o">=</span> <span class="n">median_filter</span><span class="p">(</span><span class="n">mag_spec</span><span class="p">,</span> <span class="n">fil_len_perc</span><span class="p">,</span> <sp