Bandpass#

class myoverse.transforms.Bandpass(low, high, fs, order=4, Q=0.707, dim='time', **kwargs)[source]#

Bandpass filter using cascaded torchaudio biquads (GPU-accelerated).

Uses cascaded highpass and lowpass IIR biquad filters for proper Butterworth-style roll-off at both cutoff frequencies.

Parameters:
  • low (float) – Low cutoff frequency in Hz.

  • high (float) – High cutoff frequency in Hz.

  • fs (float) – Sampling frequency in Hz.

  • order (int) – Filter order (number of biquad passes per filter). Default 4.

  • Q (float) – Quality factor. Default 0.707 for Butterworth response.

  • dim (str) – Dimension to filter over.

Examples

>>> x = torch.randn(64, 2048, device='cuda', names=('channel', 'time'))
>>> bp = Bandpass(20, 450, fs=2048, dim='time')
>>> y = bp(x)

Methods

__init__(low, high, fs[, order, Q, dim])

_apply(x)

Apply the transform.