# FIRFilter with low cut-off compared to sampling frequency

Sorry if my question is some FIRFiltering basics, but I couldn't find a specific answer after some search.

I am trying to design a decimating low pass filter in C (actually in OpenCL with GPU) with the FIR approach by doing convolution. I have a software that generates the coefficients based on the cut-off frequency and the sampling frequency.

I realized that my filter generally works if the cut-off frequency is not too far away from sampling frequency, for example fsample = 1e7 and fcutoff = 1e4 would work. (maybe the attenuation is not enough). But if I increase the fsample to 1e8, the attenuation will be negligible.

Reading from this link: How many taps does an FIR filter need? I understand that I will need a number of tap of order 1e5 or 1e6 to have sufficient attenuation (~10 - 20 dB) for my application.

So my question is, in general, how should I design my filter to meet my requirement, if I really have to cut-off something massively oversampled? If not FIR, could you point me any other better approach, for example, can IIR work better?

Maybe I can follow the approach of multi-stage decimating FIR filter in this page? Great if you provide me with some references regarding how the stages should be determined. FIR-Decimation and Low-pass filter (taps vs number of input points vs number of decimation stages)

Thanks.

• Have you considered to use a cascade of CIC and FIR? Jul 18 '18 at 5:50

For example, say you wanted to decimate a signal by a factor of 10000. If you implement this with a decimating lowpass filter, it would need to have a cutoff frequency less than $\omega = \frac{\pi}{10000}$. This would require a filter with tens to hundreds of thousands of taps, depending on how much attenuation you require in the stopband. This is a lot of processing, especially if you're trying to do real-time processing. What's more, with really long filters like this, you can run into numerical precision issues; the filter that you get might not even give you the frequency response that you designed it for!
Instead, consider an approach with two stages: two identical filters that each decimate by a factor of 100. In this case, your cutoff frequency must be less than $\omega = \frac{\pi}{100}$. And you'll only need hundreds to thousands of taps in order to implement each filter. The computational cost of two few-thousand-tap filters is much less than the cost of one filter with hundreds of thousands of taps. This only becomes more apparent when you notice that the first filter decimates by a factor of 100, making the cost of the second one negligible compared to the first stage.