Use the power at the Nyquist frequency. This is what I'd meant to use
back in
82cd9c1 (Massive rewrite (v 0.6) to base everything on Cython
and revamped pypiezo, 2011-04-21), but I goofed. Luckily, the fitting
algorithm was generally able to recover from my poor heuristic, but
using a borked heuristic is not ideal.
The fixed heuristic should reduce the number of poorly fit cases, and
improve convergence efficiency for all cases.
A_guess = Q_guess*B_guess
C_guess = max_psd * (-res_freq**4 + A_guess**4)
if offset:
- D_guess = psd_data[max_psd_index]
+ D_guess = psd_data[-1]
C_guess -= D_guess
else:
D_guess = 0