-
Notifications
You must be signed in to change notification settings - Fork 19
FIR
Mehmet Ozan Ünal edited this page Feb 8, 2017
·
4 revisions
FIR is filter structure which keep delays and coeficient of filter. filtFIR function require 2 arguments.
data
data lenght
Do not forget to add #include "simpleDSP_fir.h"
init(&fir1, 46, coef);
Serial.print("Initiliaze finished");
for(int i = 0; i<255; i++)
{
startTime = millis();
float a ;
a = filt(&fir1,input[i]);
calcTime = millis()-startTime;
Serial.println("%f",a);
Serial.print("Total calculation time: ");
Serial.println(calcTime);
}
- fir filter 10 coeficients: 190 us
- fir filter 23 coeficients: 453 us
- fir filter 46 coeficients: 900 us
for 10 coeficients implementation max frequency 5khz
filter design
output of fir functions can be used as filter coeficients
Examples:
freqz (fir1 (40, 0.3));
freqz (fir1 (15, [0.2, 0.5], "stop")); # note the zero-crossing at 0.1
freqz (fir1 (15, [0.2, 0.5], "stop", "noscale"));
filter frequency response
Output from octave
input
input FFT
output
output signal fft