MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / filterCalculateA0

Method filterCalculateA0

Source/Amiga/paula.cpp:301–313  ·  view source on GitHub ↗

Based on UAE. * Original comment in UAE: * * This computes the 1st order low-pass filter term b0. * The a1 term is 1.0 - b0. The center frequency marks the -3 dB point. */

Source from the content-addressed store, hash-verified

299 * The a1 term is 1.0 - b0. The center frequency marks the -3 dB point.
300 */
301float Paula::filterCalculateA0(int rate, int cutoff) {
302 float omega;
303 /* The BLT correction formula below blows up if the cutoff is above nyquist. */
304 if (cutoff >= rate / 2)
305 return 1.0;
306
307 omega = 2 * M_PI * cutoff / rate;
308 /* Compensate for the bilinear transformation. This allows us to specify the
309 * stop frequency more exactly, but the filter becomes less steep further
310 * from stopband. */
311 omega = tan(omega / 2) * 2;
312 return 1 / (1 + 1 / omega);
313}
314
315} // End of namespace Audio

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected