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. */
| 299 | * The a1 term is 1.0 - b0. The center frequency marks the -3 dB point. |
| 300 | */ |
| 301 | float 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 |
nothing calls this directly
no outgoing calls
no test coverage detected