mathnet / mathnet-filtering

Math.NET Filtering (formerly Neodym)
http://filtering.mathdotnet.com
Other
235 stars 80 forks source link

Added proped solution for issue #8: LP-FirCoefficients do not sum up to 1 #13

Closed josesoyo closed 5 years ago

josesoyo commented 6 years ago

As specified in the tittle, I apply the solution proposed in the issue #8. Up to now, my tests show it properly works.

TobiasGlaubach commented 5 years ago

Hi, @cdrnet regarding your comment in #9: Looks OK to me. This will result in filter coefficients beeing normalized for unit gain at DC (Frequency=0) which is a very common thing to do, when designing a FIR filter.

See here: https://dsp.stackexchange.com/questions/4693/fir-filter-gain

Alternatively you could give an additional optional parameter for the method call like: public static double[] LowPass(double samplingRate, double cutoff, int halforder = 0, normalize=true)

cdrnet commented 5 years ago

Thanks!

I'll merge the PR and then make it configurable, as suggested.