Menu

Biquad Filters

johein
2016-05-21
2016-05-23
  • johein

    johein - 2016-05-21

    Hi Everyone,
    First a big thank you to the dev(s), EQAPO ist really a powerfull tool!
    I need some help, I'm trying to put a Linkwitz-Transform on my subwoofer output, but when I activate the filter, the sound is muted. The filter was built according to the example biquad, which works just fine.
    I also tried to specify the filter for different sample rates, but this wont work either. For better analysis I tested it globally, so the problem wont be in my channel-copying configuration.
    My code:

    If: sampleRate == 44100
    Filter: ON IIR Order 2 Coefficients 1.001906993562490 -1.991348821374890 0.989509072951269 1.0 1.991370064062920 -0.991394823825732
    
    ElseIf: sampleRate == 48000
    Filter: ON IIR Order 2 Coefficients 1.001751870594630 -1.992052382112970 0.990357293085759 1.0 1.992070319366760 -0.992091226426595
    
    EndIf:
    
    #example from wiki works fine
    #Filter: ON IIR Order 2 Coefficients 0.0380602 0.0761205 0.0380602 1.2706 -1.84776 0.729402
    

    The given coefficients work just fine with my miniDSP, so they are viable.

    Any help would be greatly appreciated!

    Greetings from northern Germany :)

     
  • Juha

    Juha - 2016-05-21

    Probably just unstable filters.
    Does it work if you divide those 1st three coefficients of both sets by lets say 8.0?

     
  • johein

    johein - 2016-05-21

    Thanks for the fast reply.
    I'm not into biquad to understand, what a division by 8 means - tested it though: It does not mute anymore, no measurable effect between 20 an 200 Hz :D
    You meant it like this, didn't you?

    Filter: ON IIR Order 2 Coefficients 0.125 -0.249 0.1242 0.990357293085759 1.0 1.992070319366760 -0.992091226426595
    

    As mentioned above, the filter is stable using miniDSP.

    Fill in Linkwitz-transform parameters:      
    f(0)    57,68   
    Q(0)    0,66    
    f(p)    35  Hz
    Q(p)    0,577   
    
    LP/HP   1   
    Fs  48000   Hz
    Fc  46,34   Hz
    
    Digital coefficients: supply to the MiniDSP plugin - advanced biquad        
    a0  1   
    a1  1,992070319366760   
    a2  -0,992091226426595  
    
    b0  1,001751870594630   
    b1  -1,992052382112970  
    b2  0,990357293085759   
    
    Status  Stable  
    

    Edit: Is there a way to convert a Linkwitz-Transform into a lowshelf with identical behaviour?

     

    Last edit: johein 2016-05-21
  • Juha

    Juha - 2016-05-21

    Maybe MiniDSP scales the coefficints automatically. Here's an image showing one of the filters from your 1st post (is this what you're after?):
    test
    Blue line is the original filter. Red line is based to the coefficients which were dvided by 8.0. It looks like you need use much bigger divider to get the filter down to suitable dB area.
    Be careful with the '-' sign of the coefficients.

     

    Last edit: Juha 2016-05-21
  • johein

    johein - 2016-05-21

    Ok, I get that the filters provided by the sheet are probably for use with miniDSP only. Is there a workaround or a possibility to program a Lowshelf or Biquad with a behaviour similar to this (for example)? For this is, what the Filter above will do in miniDSP

        f0, Q0  fp, Qp  
    Frequency   Original    Target  Target equalizer
    Hz  dB  dB  dB
    10  -30,5   -22,1   8,4
    11  -29,0   -20,7   8,3
    12  -27,5   -19,3   8,2
    13  -26,0   -17,9   8,1
    14  -24,5   -16,5   8,0
    15  -23,0   -15,1   7,9
    17  -21,5   -13,8   7,7
    18  -20,1   -12,5   7,5
    20  -18,6   -11,3   7,3
    22  -17,2   -10,1   7,1
    24  -15,7   -9,0    6,8
    26  -14,3   -7,9    6,4
    28  -12,9   -6,9    6,0
    31  -11,5   -6,0    5,6
    34  -10,2   -5,1    5,1
    37  -8,9    -4,4    4,6
    40  -7,7    -3,7    4,0
    44  -6,6    -3,1    3,5
    48  -5,6    -2,6    2,9
    52  -4,6    -2,2    2,4
    57  -3,8    -1,8    1,9
    62  -3,1    -1,5    1,5
    67  -2,4    -1,3    1,2
    73  -1,9    -1,1    0,9
    80  -1,5    -0,9    0,6
    87  -1,2    -0,7    0,5
    95  -0,9    -0,6    0,3
    104 -0,7    -0,5    0,2
    

    edit: And whats the matter with the '-' ?

     

    Last edit: johein 2016-05-21
    • Juha

      Juha - 2016-05-21

      I have not checked the functions used in MiniDSP's spreadsheet but IIRC, someone mentioned few years ago that MiniDSP uses some kind of reverse signing (or ordering) for biquad coefficients.
      '-' means just the minus sign in front of coefficient.

       
  • johein

    johein - 2016-05-21

    I do know what a minus sign looks like :'D I have not yet worked myself into the depths of biquad, so I don't know how a change to the coefficients will affect the filter :/

    I think I just have do take a measurement of the mini-DSP Filter for the Linkwitz-Transform and then program the lowshelf in APO which comes the nearest (Sounds awkward to me, sorry if I messed up the grammar^^)

    Thanks for your advice! Feel free to write if a similar situation comes across.
    Cheers

     

    Last edit: johein 2016-05-21
  • Juha

    Juha - 2016-05-22

    OK, had some time to look this closer. I prepared a c++ function (based on coding found in spreadsheet from minidsp site) for to make the calculations.
    Coefficients you already have there produces this curve:

    test2

    when you use this order for the coefficients (this is the order in SynthEdit i used for to prepare a plug-in for the measure):

    a0 = 1.0017518704200765
    a1 = -1.9920523829039944
    a2 = 0.99035729404360429
    b0 = 1.0
    b1 = -1.9920703201551007
    b2 = 0.99209122721257459
    

    Notice the sign change b1/b2!
    So, coefficients got from the spreadsheet are valid but you need to do some changes before using.

    EDIT: Here is a Linkwitz Transform script: https://sourceforge.net/p/equalizerapo/discussion/general/thread/e8a40cc8/

     

    Last edit: Juha 2016-05-22
  • johein

    johein - 2016-05-23

    Awesome, thank you so much! This kind of script would be exactly what I was looking for. :)
    Great work.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.