Filter Design Results

Generated by:   http://www-users.cs.york.ac.uk/~fisher/mkfilter

Summary

You specified the following parameters:

Results

Command line: /www/usr/fisher/helpers/mkfilter -Bu -Lp -o 4 -a 2.0408163265e-03 0.0000000000e+00
raw alpha1    =   0.0020408163
raw alpha2    =   0.0020408163
warped alpha1 =   0.0020408443
warped alpha2 =   0.0020408443
gain at dc    :   mag = 6.017792167e+08   phase =   0.0000000000 pi
gain at centre:   mag = 4.255221627e+08   phase =  -1.0000000000 pi
gain at hf    :   mag = 0.000000000e+00

S-plane zeros:

S-plane poles:
	 -0.0049071507 + j   0.0118469099
	 -0.0118469099 + j   0.0049071507
	 -0.0118469099 + j  -0.0049071507
	 -0.0049071507 + j  -0.0118469099

Z-plane zeros:
	 -1.0000000000 + j   0.0000000000	4 times

Z-plane poles:
	  0.9950352017 + j   0.0117885770
	  0.9882110230 + j   0.0048494998
	  0.9882110230 + j  -0.0048494998
	  0.9950352017 + j  -0.0117885770

Recurrence relation:
y[n] = (  1 * x[n- 4])
     + (  4 * x[n- 3])
     + (  6 * x[n- 2])
     + (  4 * x[n- 1])
     + (  1 * x[n- 0])

     + ( -0.9670472415 * y[n- 4])
     + (  3.9005923504 * y[n- 3])
     + ( -5.9000375847 * y[n- 2])
     + (  3.9664924493 * y[n- 1])

Ansi ``C'' Code

/* Digital filter designed by mkfilter/mkshape/gencode   A.J. Fisher
   Command line: /www/usr/fisher/helpers/mkfilter -Bu -Lp -o 4 -a 2.0408163265e-03 0.0000000000e+00 -l */

#define NZEROS 4
#define NPOLES 4
#define GAIN   6.017792167e+08

static float xv[NZEROS+1], yv[NPOLES+1];

static void filterloop()
  { for (;;)
      { xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; 
        xv[4] = next input value / GAIN;
        yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4]; 
        yv[4] =   (xv[0] + xv[4]) + 4 * (xv[1] + xv[3]) + 6 * xv[2]
                     + ( -0.9670472415 * yv[0]) + (  3.9005923504 * yv[1])
                     + ( -5.9000375847 * yv[2]) + (  3.9664924493 * yv[3]);
        next output value = yv[4];
      }
  }

Download code and/or coefficients:

Magnitude (red) and phase (blue) vs. frequency

For an expanded view, enter frequency limits (as a fraction of the sampling rate) here:

Lower limit: Upper limit:

Impulse response

Step response

For a view on a different scale, enter upper time limit (integer number of samples) here:

Upper limit:

Tony Fisher fisher@minster.york.ac.uk