music.high_pass

music.high_pass(cutoff=0.1)[source]

A one-pole high pass, from the article’s equation eq:passa-altas.

x = exp(-2 pi f_c), then a_0 = (x + 1) / 2, a_1 = -a_0 and b_1 = x.

Parameters:
cutoffscalar

Where the filter attenuates by 3 dB, as a fraction of the sample rate, in (0, 0.5).

Returns:
a, bndarray

The feedforward and feedback coefficients, for iir().

Raises:
ValueError

If cutoff is outside (0, 0.5), which is where a fraction of the sample rate has a filter to describe.

Parameters:

cutoff (float)

Return type:

tuple[NDArray[float64], NDArray[float64]]

See also

low_pass

the complementary filter, from the same pole.

Examples

>>> a, b = high_pass(cutoff=0.05)
>>> [round(float(v), 6) for v in a]
[0.865201, -0.865201]