sdynpy.signal_processing.sdynpy_harmonic.digital_tracking_filter

digital_tracking_filter(dt, xs, frequencies, arguments, cutoff_frequency_ratio=0.15, filter_order=2, phase_estimate=None, amplitude_estimate=None, block_size=None, plot_results=False)[source]

Computes amplitudes and phases using a digital tracking filter

Parameters
  • dt (float) – The time step of the signal

  • xs (iterable) – The signal that will have amplitude and phase extracted.

  • frequencies (iterable) – The instantaneous frequency at each time step.

  • arguments (iterable) – The instantaneous argument to the sine wave at each time step.

  • cutoff_frequency_ratio (float) – The cutoff frequency of the low-pass filter compared to the lowest frequency sine tone in each block. Default is 0.15.

  • filter_order (float) – The filter order of the low-pass butterworth filter. Default is 2.

  • phase_estimate (float) – An estimate of the initial phase to seed the low-pass filter.

  • amplitude_estimate (float) – An estimate of the initial amplitude to seed the low-pass filter.

  • block_size (int) – Number of samples to use for each block. If not specified, the entire signal is treated as a single block.

  • plot_results (bool) – If True, will plot the data at multiple steps for diagnostics

Returns

  • amplitude (np.ndarray) – The amplitude at each time step

  • phase (np.ndarray) – The phase at each time step