# Implementation of the filter function (Matlab) C/C++

I am trying to apply some filtering in C/C++ code, I have designed an algorithm using Matlab and it works well, so now I am moving it to native code.

I am interested in the filter function.
In my matlab script it is used as follows.

[y_blk, fir1_state] = filter( h, 1, x.*c, fir1_state );


Where the h argument is coefficients generated by firpm function.

I would be very grateful if someone could provide an implementation of this function

Or maybe there is an existing implementation of this function in some library.

Thanks

• The filter function is implemented in a large number of open-source packages, such as octave and SciPy. – MBaz Nov 19 '17 at 19:33
• look at dsp.stackexchange.com/questions/1571/… and also Google "signal processing c library" – user28715 Nov 19 '17 at 21:28
• You can find a lot of implementations of a FIR Filter on the INTERNET. I wanted to write the code but I already found it on the below link. stackoverflow.com/questions/14997850/… – George Alex Feb 22 '18 at 15:23