Convert formant freqencies and bandwidth into resonator difference equation coefficents */
| 8 | /* Convert formant freqencies and bandwidth into resonator difference equation coefficents |
| 9 | */ |
| 10 | void resonator::initResonator( |
| 11 | int aFrequency, /* Frequency of resonator in Hz */ |
| 12 | int aBandwidth, /* Bandwidth of resonator in Hz */ |
| 13 | int aSamplerate) |
| 14 | { |
| 15 | float arg = (-PI / aSamplerate) * aBandwidth; |
| 16 | float r = (float)exp(arg); |
| 17 | mC = -(r * r); |
| 18 | arg = (-2.0f * PI / aSamplerate) * aFrequency; |
| 19 | mB = r * (float)cos(arg) * 2.0f; |
| 20 | mA = 1.0f - mB - mC; |
| 21 | } |
| 22 | |
| 23 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants |
| 24 | */ |
no outgoing calls
no test coverage detected