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 3.6785714286e-01 0.0000000000e+00
raw alpha1    =   0.3678571429
raw alpha2    =   0.3678571429
warped alpha1 =   0.7221927531
warped alpha2 =   0.7221927531
gain at dc    :   mag = 1.058175797e+01   phase =   0.0000000000 pi
gain at centre:   mag = 1.043657081e+01   phase =  -0.1600415182 pi
gain at hf    :   mag = 0.000000000e+00

S-plane zeros:

S-plane poles:
	 -0.3664228981 + j   4.7061905791
	 -1.0266941456 + j   3.7740718173
	 -1.4836160259 + j   2.0944518461
	 -1.6466895570 + j   0.0000000000
	 -1.4836160259 + j  -2.0944518461
	 -1.0266941456 + j  -3.7740718173
	 -0.3664228981 + j  -4.7061905791

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

Z-plane poles:
	 -0.6588717108 + j   0.6784141338
	 -0.4827157644 + j   0.6450165631
	 -0.1566273227 + j   0.5070603211
	  0.0968852537 + j   0.0000000000
	 -0.1566273227 + j  -0.5070603211
	 -0.4827157644 + j  -0.6450165631
	 -0.6588717108 + j  -0.6784141338

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.0158398918 * y[n- 7])
     + ( -0.0989743038 * y[n- 6])
     + ( -0.4806770487 * y[n- 5])
     + ( -1.5976153081 * y[n- 4])
     + ( -2.8744063538 * y[n- 3])
     + ( -3.5609112971 * y[n- 2])
     + ( -2.4995443421 * 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 3.6785714286e-01 0.0000000000e+00 -l */

#define NZEROS 7
#define NPOLES 7
#define GAIN   1.058175797e+01

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.0158398918 * yv[0]) + ( -0.0989743038 * yv[1])
                     + ( -0.4806770487 * yv[2]) + ( -1.5976153081 * yv[3])
                     + ( -2.8744063538 * yv[4]) + ( -3.5609112971 * yv[5])
                     + ( -2.4995443421 * 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