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 -Ch -1.2000000000e-01 -Lp -o 7 -a 1.0729166667e-01 0.0000000000e+00
raw alpha1    =   0.1072916667
raw alpha2    =   0.1072916667
warped alpha1 =   0.1115485037
warped alpha2 =   0.1115485037
gain at dc    :   mag = 3.508040262e+04   phase =  -0.0000000000 pi
gain at centre:   mag = 3.459908145e+04   phase =  -0.1600415182 pi
gain at hf    :   mag = 0.000000000e+00

S-plane zeros:

S-plane poles:
	 -0.0565969761 + j   0.7269091455
	 -0.1585812031 + j   0.5829358743
	 -0.2291564779 + j   0.3235050039
	 -0.2543445019 + j   0.0000000000
	 -0.2291564779 + j  -0.3235050039
	 -0.1585812031 + j  -0.5829358743
	 -0.0565969761 + j  -0.7269091455

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

Z-plane poles:
	  0.7289635569 + j   0.6111063258
	  0.7271112334 + j   0.4664152061
	  0.7573882094 + j   0.2550399154
	  0.7743517003 + j   0.0000000000
	  0.7573882094 + j  -0.2550399154
	  0.7271112334 + j  -0.4664152061
	  0.7289635569 + j  -0.6111063258

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

     + (  0.3339406563 * y[n- 7])
     + ( -2.4120965667 * y[n- 6])
     + (  7.7656156821 * y[n- 5])
     + (-14.4501981953 * y[n- 4])
     + ( 16.8069704710 * y[n- 3])
     + (-12.2491585077 * y[n- 2])
     + (  5.2012776995 * y[n- 1])

Ansi ``C'' Code

/* Digital filter designed by mkfilter/mkshape/gencode   A.J. Fisher
   Command line: /www/usr/fisher/helpers/mkfilter -Ch -1.2000000000e-01 -Lp -o 7 -a 1.0729166667e-01 0.0000000000e+00 -l */

#define NZEROS 7
#define NPOLES 7
#define GAIN   3.508040262e+04

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] = xv[5]; xv[5] = xv[6]; xv[6] = xv[7]; 
        xv[7] = next input value / GAIN;
        yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4]; yv[4] = yv[5]; yv[5] = yv[6]; yv[6] = yv[7]; 
        yv[7] =   (xv[0] + xv[7]) + 7 * (xv[1] + xv[6]) + 21 * (xv[2] + xv[5])
                     + 35 * (xv[3] + xv[4])
                     + (  0.3339406563 * yv[0]) + ( -2.4120965667 * yv[1])
                     + (  7.7656156821 * yv[2]) + (-14.4501981950 * yv[3])
                     + ( 16.8069704710 * yv[4]) + (-12.2491585080 * yv[5])
                     + (  5.2012776995 * yv[6]);
        next output value = yv[7];
      }
  }

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