cedalion.sigproc.frequency

Frequency-related signal processing methods.

Functions

freq_filter(timeseries, fmin, fmax[, ...])

Apply a Butterworth bandpass frequency filter.

sampling_rate(timeseries)

Estimate the sampling rate of the timeseries.

cedalion.sigproc.frequency.sampling_rate(
timeseries: Annotated[DataArray, DataArraySchema(dims='time', coords='time', 'time', 'samples')],
) Quantity[source]

Estimate the sampling rate of the timeseries.

Note

This functions assumes uniform sampling.

Parameters:

timeseries (NDTimeSeries, (time,*)) – the input time series

Returns:

The sampling rate estimated by averaging time differences between samples.

cedalion.sigproc.frequency.freq_filter(
timeseries: Annotated[DataArray, DataArraySchema(dims='time', coords='time', 'time', 'samples')],
fmin: Annotated[Quantity, '[frequency]'],
fmax: Annotated[Quantity, '[frequency]'],
butter_order: int = 4,
) Annotated[DataArray, DataArraySchema(dims='time', coords='time', 'time', 'samples')][source]

Apply a Butterworth bandpass frequency filter.

Parameters:
  • timeseries (NDTimeSeries, (time,*)) – the input time series

  • fmin (Quantity, [frequency]) – lower threshold of the pass band

  • fmax (Quantity, [frequency]) – higher threshold of the pass band

  • butter_order – order of the filter

Returns:

The frequency-filtered time series