biquad bandpass Q value

Fermuto

Member
Hello,

Just a simple and short question, how is the Q (passband width) value in biquad,setBandpass defined? As in, what is the value in? Hz? The only documentation for the library that I'm aware of is the audio system design tool, which doesn't explain Q, and the example in the arduino IDE only shows lowpass which has a different use for its Q value.
Thanks!
 
Hey, could you go into further detail as to how you did this exactly? If you're correct about the bandpass quality then I'd probably want to do the same. Actually, what exactly was wrong with the bandpass?

Thanks.
 
In one of my programs I used one bi-quad of high pass and 3 bi-quads of low pass. For the narrow band mode of CW, the bandwidth is split plus and minus from the center frequency of 700 hz. You can ignore the wv variable, this was a Weaver mode radio. I implemented a tone control by varying the Q of the lowpass filter sections - and that sort of works ok.


Code:
   if( mode == CW ){
       wv = 2500;
       hp = ( bw > 1000 ) ? 200 : 700 - bw/2;
       bw = ( bw > 1000 ) ? bw : 700 + bw/2 ;
   }
   else if( mode == AM || mode == DIGI ) wv = 6000, hp = 100;      // for digi mode, set weaver hole at 3k hz
   else hp = 200, wv = 4000;                                       // SSB

   BandWidth.setHighpass(0,hp,0.70710678);
   BandWidth.setLowpass(1,bw,0.51763809 + tone_);
   BandWidth.setLowpass(2,bw,0.70710678 + tone_);
   BandWidth.setLowpass(3,bw,1.9318517 + tone_/2);

Actually I found I did use a bandpass section in another program. The Q value used was most likely found by trial. ( And it looks like my other Q's are incorrect, I probably wrote this program before I found the online calculator linked above )

Code:
      if( mode_menu_data.current == 1 ){         // cw/hell modes, change last to bandpass response
         BandWidth.setLowpass(0,sel,0.67); 
         BandWidth.setLowpass(1,sel,1.10);
         BandWidth.setLowpass(2,sel,0.707);     
         BandWidth.setBandpass(3,700,2.5);
      }
 
In one of my programs I used one bi-quad of high pass and 3 bi-quads of low pass. For the narrow band mode of CW, the bandwidth is split plus and minus from the center frequency of 700 hz. You can ignore the wv variable, this was a Weaver mode radio. I implemented a tone control by varying the Q of the lowpass filter sections - and that sort of works ok.


Code:
   if( mode == CW ){
       wv = 2500;
       hp = ( bw > 1000 ) ? 200 : 700 - bw/2;
       bw = ( bw > 1000 ) ? bw : 700 + bw/2 ;
   }
   else if( mode == AM || mode == DIGI ) wv = 6000, hp = 100;      // for digi mode, set weaver hole at 3k hz
   else hp = 200, wv = 4000;                                       // SSB

   BandWidth.setHighpass(0,hp,0.70710678);
   BandWidth.setLowpass(1,bw,0.51763809 + tone_);
   BandWidth.setLowpass(2,bw,0.70710678 + tone_);
   BandWidth.setLowpass(3,bw,1.9318517 + tone_/2);

Actually I found I did use a bandpass section in another program. The Q value used was most likely found by trial. ( And it looks like my other Q's are incorrect, I probably wrote this program before I found the online calculator linked above )

Code:
      if( mode_menu_data.current == 1 ){         // cw/hell modes, change last to bandpass response
         BandWidth.setLowpass(0,sel,0.67); 
         BandWidth.setLowpass(1,sel,1.10);
         BandWidth.setLowpass(2,sel,0.707);     
         BandWidth.setBandpass(3,700,2.5);
      }

Huh, very interesting. Do you remember what is wrong about bandpass filters? It feels like I'd have faster filtering since using a Bandpass will remove a difference equation in calculation.

For context, I am trying to implement a 8-band graphic equalizer. Do you have any tips?

My thoughts:
Would cascading purely lowpass/highpass be quicker? This is mostly just splitting up a signal into different bands.
How could I "sharpen" the edges of the filters? Cascading doesn't seem to be enough?

I also found this updated calculator:
https://www.earlevel.com/main/2021/0...calculator-v3/

Rather unsure how to proceed.
 
You don't want sharp edges with a graphic equalizer normally, you want smooth transitions. The Q of the individual stages needs to match their geometric spacing. Sounds like you have one control per octave, and a Q of about 2 is a good design point.

With equalizers its best to run the stages in parallel and sum the results to keep noise down (true both in the analog and digital worlds).
 
Back
Top