New whitening scheme based on inverse spectrum truncation
Created by: alurban
This pull request addresses a common issue with filter transients in the current whitening method by replacing it with an alternative scheme which designs and applies an FIR (finite impulse response) filter using inverse spectrum truncation.
Other new features added include:
- A method
FrequencySeries.interpolate()
and functionstimeseries._fft_length_default
,signal.filter_design.truncate_transfer
, andsignal.filter_design.truncate_impulse
, all used to design the FIR filter - New keyword arguments for filter duration (in the time domain) and highpass corner frequency
- In
TimeSeries.whiten()
, a default value offftlength
which causes it to be set tomax(2, int(2048 // self.sample_rate.decompose().value))
- Automatic cropping of the beginning and end of the whitened timeseries by a segment of length
filter_duration
- Updates to the documentation for
TimeSeries.whiten()
addressing these changes - Updates to
q_transform()
that address these recent changes, including a new defaultfftlength
that mirrors the one forTimeSeries.whiten
- Unit tests for new functionality, a unit test for
signal.window.planck()
, and a bug fix in the unit test forFrequencySeries.inject()
Note, these changes make it so that a simple call to TimeSeries.whiten()
with no other arguments returns something sensible in most cases. It is also backwards compatible.
This fixes #867 (closed). It is also related to #358 (closed) and #451 (closed).