  <span class="k">else</span><span class="p">:</span>
        <span class="n">kernel_window</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">np</span><span class="p">,</span> <span class="n">method</span><span class="p">)(</span><span class="n">kernel_size</span><span class="p">)</span>

    <span class="n">denoised_spectrum</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">convolve</span><span class="p">(</