title: python scipy.signal.peak_widths --> absolute heigth? (fft -3dB damping)
body: <p><a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.peak_widths.html" rel="nofollow noreferrer">https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.peak_widths.html</a></p>
  
  <p>I think the linked function can only calculate the peak widths at a relative height. Does anyone know if there is a function that calculates the width at a fixed value (peak_amplitude - x) for all peaks?</p>
  
  <p>Currently I am trying to change the original inner function "_peak_widths". Fail already with the cimport. Understand the source code here only partially. I added in the code where I would make a modification.</p>
  
  <pre><code> with nogil:
      for p in range(peaks.shape[0]):
          i_min = left_bases[p]
          i_max = right_bases[p]
          peak = peaks[p]
          # Validate bounds and order
          if not 0 &lt;= i_min &lt;= peak &lt;= i_max &lt; x.shape[0]:
              with gil:
                  raise ValueError("prominence data is invalid for peak {}"
                                   .format(peak))
          height = width_heights[p] = x[peak] - prominences[p] * rel_height 
  </code></pre>
  
  <h1>CHANGE HERE TO x[peak] - 3</h1>
  
  <pre><code>        # Find intersection point on left side
          i = peak
          while i_min &lt; i and height &lt; x[i]:
              i -= 1
          left_ip = &lt;np.float64_t&gt;i
          if x[i] &lt; height:
              # Interpolate if true intersection height is between samples
              left_ip += (height - x[i]) / (x[i + 1] - x[i])
  
          # Find intersection point on right side
          i = peak
          while i &lt; i_max and height &lt; x[i]:
              i += 1
          right_ip = &lt;np.float64_t&gt;i
          if  x[i] &lt; height:
              # Interpolate if true intersection height is between samples
              right_ip -= (height - x[i]) / (x[i - 1] - x[i])
  
          widths[p] = right_ip - left_ip
          if widths[p] == 0:
              show_warning = True
          left_ips[p] = left_ip
          right_ips[p] = right_ip
  </code></pre>