Convert formant freqencies and bandwidth into anti-resonator difference equation constants */
| 23 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants |
| 24 | */ |
| 25 | void resonator::initAntiresonator( |
| 26 | int aFrequency, /* Frequency of resonator in Hz */ |
| 27 | int aBandwidth, /* Bandwidth of resonator in Hz */ |
| 28 | int aSamplerate) |
| 29 | { |
| 30 | initResonator(aFrequency, aBandwidth, aSamplerate); /* First compute ordinary resonator coefficients */ |
| 31 | /* Now convert to antiresonator coefficients */ |
| 32 | mA = 1.0f / mA; /* a'= 1/a */ |
| 33 | mB *= -mA; /* b'= -b/a */ |
| 34 | mC *= -mA; /* c'= -c/a */ |
| 35 | } |
| 36 | |
| 37 | /* Generic resonator function */ |
| 38 | float resonator::resonate(float input) |