vibration_analyze: Add smooth_window to PSD fitting
authorW. Trevor King <wking@tremily.us>
Sun, 5 May 2013 00:13:21 +0000 (20:13 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 5 May 2013 00:13:21 +0000 (20:13 -0400)
commit3418c8c094616215515bf0a6f349ba06e450b16a
tree5bfb01d1eba38db96ccabec469b0e84e481450d0
parente0b67bd92319e6da1e804af794c33c7fbfd4cfc1
vibration_analyze: Add smooth_window to PSD fitting

Sometimes the broad resonant peak from the cantilever has sharper
unidentified peaks sitting on its shoulders.  In the rare case that
these peaks are taller than the cantilever peak, they can throw off
the resonant frequency portion of the parameter-guessing heuristic.
By smoothing the PSD data somewhat, we can damp down the sharp peaks
and bring the cantilever peak back to the top.

Because the amount of smoothing you'll need depends on your noise
sources and the expected width of the cantilever peak, make the
smoothing configurable.  A 10-sample-wide Hann filter (rescaled to
have unit weight) seems like a pretty conservative default.
calibcant/config.py
calibcant/vibration_analyze.py