Time Domain Digital Filter Representations
Finite Impulse Response Digital Filters
FIR Software ImplementationsSearch Introduction to Digital Filters
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
In matlab, an efficient FIR filter is implemented by calling
outputsignal = filter(B,1,inputsignal);
where
Figure 5.6 lists a second-order FIR filter implementation in the C programming language.
typedef double *pp; // pointer to array of length NTICK typedef double word; // signal and coefficient data type typedef struct _fir3Vars { pp outputAout; pp inputAinp; word b0; word b1; word b2; word s1; word s2; } fir3Vars; void fir3(fir3Vars *a) { int i; word input; for (i=0; i<NTICK; i++) { input = a->inputAinp[i]; a->outputAout[i] = a->b0 * input + a->b1 * a->s1 + a->b2 * a->s2; a->s2 = a->s1; a->s1 = input; } } |
