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 4.0234375000e-01 0.0000000000e+00
raw alpha1    =   0.4023437500
raw alpha2    =   0.4023437500
warped alpha1 =   1.0047707268
warped alpha2 =   1.0047707268
gain at dc    :   mag = 5.561213831e+00   phase =   0.0000000000 pi
gain at centre:   mag = 5.484911116e+00   phase =  -0.1600415182 pi
gain at hf    :   mag = 0.000000000e+00

S-plane zeros:

S-plane poles:
	 -0.5097960346 + j   6.5476183591
	 -1.4284167468 + j   5.2507822418
	 -2.0641220039 + j   2.9139643049
	 -2.2910025834 + j   0.0000000000
	 -2.0641220039 + j  -2.9139643049
	 -1.4284167468 + j  -5.2507822418
	 -0.5097960346 + j  -6.5476183591

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

Z-plane poles:
	 -0.7958286337 + j   0.5326473419
	 -0.6512713989 + j   0.5340943301
	 -0.3499556605 + j   0.4660800045
	 -0.0678169210 + j   0.0000000000
	 -0.3499556605 + j  -0.4660800045
	 -0.6512713989 + j  -0.5340943301
	 -0.7958286337 + j  -0.5326473419

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.0149874278 * y[n- 7])
     + ( -0.3054088784 * y[n- 6])
     + ( -1.4843264402 * y[n- 5])
     + ( -3.9335563225 * y[n- 4])
     + ( -6.3075567034 * y[n- 3])
     + ( -6.3087937978 * y[n- 2])
     + ( -3.6619283073 * 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 4.0234375000e-01 0.0000000000e+00 -l */

#define NZEROS 7
#define NPOLES 7
#define GAIN   5.561213831e+00

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.0149874278 * yv[0]) + ( -0.3054088784 * yv[1])
                     + ( -1.4843264402 * yv[2]) + ( -3.9335563225 * yv[3])
                     + ( -6.3075567034 * yv[4]) + ( -6.3087937978 * yv[5])
                     + ( -3.6619283073 * 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