MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / initResonator

Method initResonator

extlibs/soloud/src/audiosource/speech/resonator.cpp:10–21  ·  view source on GitHub ↗

Convert formant freqencies and bandwidth into resonator difference equation coefficents */

Source from the content-addressed store, hash-verified

8/* Convert formant freqencies and bandwidth into resonator difference equation coefficents
9 */
10void 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 */

Callers 3

pitch_synch_par_resetMethod · 0.80
frame_initMethod · 0.80
initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected