BGlib.gmode.proc.fft.HarmonicPassFilter

class BGlib.gmode.proc.fft.HarmonicPassFilter(signal_length, samp_rate, first_freq, band_width, num_harm, do_plots=False)[source]

Bases: FrequencyFilter

Builds a filter that only keeps N harmonics

Parameters:
  • signal_length (unsigned int) – Number of points in the FFt signal

  • samp_rate (unsigned int) – Sampling rate

  • first_freq (unsigned int) – Frequency of the first harmonic

  • band_width (unsigned int) – Frequency band around each harmonic that needs to be preserved

  • num_harm (unsigned int) – Number of harmonics to preserve

  • do_plots (Boolean (optional)) – Whether or not to generate plots. Not necessary after debugging

  • units (Note that the frequency values must all have the same) –

Returns:

harm_filter – 0s where the signal is to be rejected and 1s at harmonics

Return type:

1D numpy array

Methods

get_parms

is_compatible