Skip to content

Ozuba/SimpleFIR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleFIR

This is a simple implementation of a FIR filter i made for real time proccessing on an STM32F103C8, as it lacks a floating point unit it had to be implemented using only integer arithmetics in order to maximize performance.

Library interface

The library defines a FIR_t object which can be created dynamicaly by an initialization funcion

Example usage

//Coefficents
float coeffs[N] = {...};

int main(){
FIR_t * filter;
filt = initFilter(&coeffs,N,xMax); // Coefficents, Order of the Filter (TAPS), Upper bounding for Signal

while(1){
    int x = readSignal();
    x = filter(filt,x); // Returns filtered signal with a delay of N samples
}

deInitFilter(filt);
return 1;
}

Results

The following signal was filtered using this library, take in mind that there is still a quatization noise due to the lack of resolution of the adc at the range of the input signal.

Pre-Filtering After-Filtering
image image

Filter Design

I recommend to use the awesome work by Christian Münker with his pyfda, aswell as to read a bit about how filters really work, (Laplace/Z-Transform/Transfer-Functions...)

About

A simple and intuitive to use fixpoint FIR filter in c

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages