span><span class="n">kernel_window</span> <span class="o">/</span> <span class="n">kernel_window</span><span class="o">.</span><span class="n">sum</span><span class="p">(),</span> <span class="n">padded_spectrum</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;valid&#39;</span><span class="p">)</span>

    <span class="n">denoised_spectrum</span> <span class="o">=</span> <span class="n">denoised_spectrum</span><span class="p">[</span><span class="nb">in