funcs/func_resonance.c
static void bilinear(
double a0, double a1, double a2,	/* numerator coefficients */
double b0, double b1, double b2,	/* denominator coefficients */
double *k, /* overall gain factor */
double fs, /* sampling rate */
float *coef /* pointer to 4 iir coefficients */
)
{
	double ad, bd;

	/* alpha (Numerator in s-domain) */
	ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0;
	/* beta (Denominator in s-domain) */
	bd = 4. * b2 * fs * fs + 2. * b1* fs + b0;

	/* update gain constant for this section */
	*k *= ad/bd;

	/* Denominator */
	*coef++ = (2. * b0 - 8. * b2 * fs * fs)
	/ bd; /* beta1 */
	*coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0)
	/ bd; /* beta2 */

	/* Nominator */
	*coef++ = (2. * a0 - 8. * a2 * fs * fs)
	/ ad; /* alpha1 */
	*coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0)
	/ ad; /* alpha2 */
}
/*
* ----------------------------------------------------------
* bilinear()
*
* Transform the numerator and denominator coefficients
* of s-domain biquad section into corresponding
* z-domain coefficients.
*
* Store the 4 IIR coefficients in array pointed by coef
* in following order:
* beta1, beta2	(denominator)
* alpha1, alpha2 (numerator)
*
* Arguments:
* a0-a2 - s-domain numerator coefficients
* b0-b2 - s-domain denominator coefficients
* k - filter gain factor. initially set to 1
* and modified by each biquad section in such
* a way, as to make it the coefficient by
* which to multiply the overall filter gain
* in order to achieve a desired overall filter gain,
* specified in initial value of k.
* fs - sampling rate (Hz)
* coef	- array of z-domain coefficients to be filled in.
*
* Return:
* On return, set coef z-domain coefficients
* ----------------------------------------------------------
*/
bilinear()
Transform the numerator and denominator coefficients
of s-domain biquad section into corresponding
z-domain coefficients.

Store the 4 IIR coefficients in array pointed by coef
in following order:
beta1, beta2   (denominator)
alpha1, alpha2 (numerator)



On return, set coef z-domain coefficients
bilinear () Transform the numerator and denominator coefficients of s - domain biquad section into corresponding z - domain coefficients . Store the 4 IIR coefficients in array pointed by coef in following order : beta1 beta2 ( denominator ) alpha1 alpha2 ( numerator ) On return set coef z - domain coefficients
static void bilinear(
double a0, double a1, double a2,	
double b0, double b1, double b2,	
double *k, 
double fs, 
float *coef 
)
{
	double ad, bd;
	ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0;
	bd = 4. * b2 * fs * fs + 2. * b1* fs + b0;
	*k *= ad/bd;
	*coef++ = (2. * b0 - 8. * b2 * fs * fs)
	/ bd; 
	*coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0)
	/ bd; 
	*coef++ = (2. * a0 - 8. * a2 * fs * fs)
	/ ad; 
	*coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0)
	/ ad; 
}
static void bilinear ( double a0 , double a1 , double a2 , double b0 , double b1 , double b2 , double * k , double fs , float * coef ) { double ad , bd ; ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0 ; bd = 4. * b2 * fs * fs + 2. * b1 * fs + b0 ; * k *= ad / bd ; * coef ++ = ( 2. * b0 - 8. * b2 * fs * fs ) / bd ; * coef ++ = ( 4. * b2 * fs * fs - 2. * b1 * fs + b0 ) / bd ; * coef ++ = ( 2. * a0 - 8. * a2 * fs * fs ) / ad ; * coef = ( 4. * a2 * fs * fs - 2. * a1 * fs + a0 ) / ad ; }
bilinear()
Transform the numerator and denominator coefficients
of s-domain biquad section into corresponding
z-domain coefficients.
bilinear () Transform the numerator and denominator coefficients of s - domain biquad section into corresponding z - domain coefficients .
/* numerator coefficients */ /* denominator coefficients */ /* overall gain factor */ /* sampling rate */ /* pointer to 4 iir coefficients */ /* alpha (Numerator in s-domain) */ /* beta (Denominator in s-domain) */ /* update gain constant for this section */ /* Denominator */ /* beta1 */ /* beta2 */ /* Nominator */ /* alpha1 */ /* alpha2 */