BGlib.gmode.proc.gmode_utils.test_filter

BGlib.gmode.proc.gmode_utils.test_filter(resp_wfm, frequency_filters=None, noise_threshold=None, excit_wfm=None, show_plots=True, plot_title=None, verbose=False)[source]

Filters the provided response with the provided filters.

Parameters:
  • resp_wfm (array-like, 1D) – Raw response waveform in the time domain

  • frequency_filters ((Optional) FrequencyFilter object or list of) – Frequency filters to apply to signal

  • noise_threshold ((Optional) float) – Noise threshold to apply to signal

  • excit_wfm ((Optional) 1D array-like) – Excitation waveform in the time domain. This waveform is necessary for plotting loops. If the length of resp_wfm matches excit_wfm, a single plot will be returned with the raw and filtered signals plotted against the excit_wfm. Else, resp_wfm and the filtered (filt_data) signal will be broken into chunks matching the length of excit_wfm and a figure with multiple plots (one for each chunk) with the raw and filtered signal chunks plotted against excit_wfm will be returned for fig_loops

  • show_plots ((Optional) Boolean) – Whether or not to plot FFTs before and after filtering

  • plot_title (str / unicode (Optional)) – Title for the raw vs filtered plots if requested. For example - ‘Row 15’

  • verbose ((Optional) Boolean) – Prints extra debugging information if True. Default False

Returns:

  • filt_data (1D numpy float array) – Filtered signal in the time domain

  • fig_fft (matplotlib.pyplot.figure object) – handle to the plotted figure if requested, else None

  • fig_loops (matplotlib.pyplot.figure object) – handle to figure with the filtered signal and raw signal plotted against the excitation waveform