Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: very narrbandpass filter needed

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    4

    very narrbandpass filter needed

    What is the best filter for a very narrow bandpass operating in the 500 - 1500 Hz range. It needs to be as narrow (several Hz) and brick-wall as possible. I have been getting okay results with four concatenated biquads with each of the four sections used (16 instances total). I have tried using the filter Q with what seems like a high setting of 5 - 25 to get the best results.

    Would I be better off going to a lower sampling rate and skip the library?

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,154
    Quote Originally Posted by Martin_R View Post
    What is the best filter for a very narrow bandpass operating in the 500 - 1500 Hz range. It needs to be as narrow (several Hz) and brick-wall as possible.
    Can you be a little be more specific?
    (e,g. bandpass ripple, min transition band, and min stop band attenuation)

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    You probably want to use a slower sample rate. That will give you 2 advantages. First, the filter's passband will be closer to the center of the total bandwidth, which makes for a simpler filter. Second, lower sample rate will let you do more work per sample.

    As a quick check, I write plugging in some numbers to the TFilter design tool.

    Click image for larger version. 

Name:	tfilter.png 
Views:	14 
Size:	111.2 KB 
ID:	16299

    It says a 273 tap FIR filter can do the job pretty well. At 8 kHz sample rate, if you use the arm_math.h optimized function (as the audio library does for the FIR filters), you can probably get this to run on Teensy 3.6 with 8 kHz sample rate.

    If you want to explore other sample rates, passband flatness and stopband attenuation, and try squeezing those bands closer, just click that like to the TFilter tool and fiddle away!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •