music.low_pass¶
- music.low_pass(cutoff=0.1)[source]¶
A one-pole low pass, from the article’s equation
eq:passa-baixas.x = exp(-2 pi f_c), thena_0 = 1 - xandb_1 = x.- Parameters:
- cutoffscalar
Where the filter attenuates by 3 dB, as a fraction of the sample rate, in
(0, 0.5).
- Returns:
- Raises:
ValueErrorIf 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
high_passthe complementary filter, from the same pole.
fraction_ofconverts a frequency in Hertz into a cutoff.
Notes
One pole, so the roll-off above the cutoff is 6 dB per octave. The article gives it “for didactic purposes and as a reference”, and names biquad recipes and Chebyshev coefficients as what to reach for when this is not sharp enough.
Examples
>>> a, b = low_pass(cutoff=0.05) >>> [round(float(v), 6) for v in a] [0.269597] >>> [round(float(v), 6) for v in b] [1.0, 0.730403]