Beispiel #1
0
int main() {
	printf("i2i: %d\n", i2i(1));
	printf("I2I: %d\n", I2I(1));
	printf("s2s: %d\n", s2s(1));
	printf("S2S: %d\n", S2S(1));
	printf("l2l: %d\n", l2l(1));
	printf("L2L: %d\n", L2L(1));
	printf("q2q: %lld\n", q2q(1));
	printf("Q2Q: %lld\n", Q2Q(1));
	printf("f2f: %f\n", f2f(1.1));
	printf("d2d: %f\n", d2d(1.1));

	return 0;
}
static Hook *bwt_new(double fl, int ol, double fu, int ou, double dt)
	{
    int  nsout;
    double     gn;
    Butterworth *butflc ;
    Hook	*hook ;

//    allot(Butterworth *, butflc, 1); 
	butflc=new Butterworth();
    hook = new_hook(free) ; 
    hook->p = (void *) butflc ;

    butflc->ns = 0;
    if (ol + ou > MAX_ORDER) {
	return 0;
    }
    if (fu == (double) 0. || ou == 0) {
	butflc->ns = 0;
	butflc->gain = (double) 1.;
    } else {
	butsta (ou, &nsout, butflc->is, butflc->b, butflc->c);
	l2l (fu, nsout, butflc->is, butflc->b, butflc->c, &gn);
	butflc->ns = nsout;
	butflc->gain = gn;
    }
    if (fl != (double) 0. && ol != 0) {
	butsta (ol, &nsout, &butflc->is[butflc->ns], &butflc->b[
				    butflc->ns], &butflc->c[butflc->ns]);
	l2h (fl, nsout, &butflc->is[butflc->ns], &butflc->b[butflc->ns],
	      &butflc->c[butflc->ns], &gn);
	butflc->ns += nsout;
	butflc->gain *= gn;
    }
    butflc->gain = (double) 1.;

    recoef (butflc, dt, 0, 1);

    return hook;
	}