Solved

Audio filter design - how to calculate kernel order from cutoff frequency

Posted on 2004-10-25
409 Views
Last Modified: 2012-08-14
I have written a filter design wizzard to go with an audio DSP application, which offers the following FIR windowing functions as kernels: Blackman, Hamming, Hanning, Triangular and Rectangular. It allows low pass and high pass filtering. It works fine, but I just don't know how to calculate an appropriate filter order to give the desired cutoff frequency. I need to know how to calculate this for EACH of the above windowing functions.
Thanks.
0
Question by:HorridMan
    11 Comments
     
    LVL 3

    Accepted Solution

    by:
    So, your situation is:

    given order, CAN calculate cutoff;
    given cutoff,CANNOT calculate order.

    why don't you just pre-calc some table of (order, cutoff) value pairs, and then use some sort of interpolation on that data to select order that result into given cutoff ?..

    yeah, that's called cheating.
    0
     
    LVL 22

    Expert Comment

    by:grg99
    I don't quite get your question.   IIRC the cutoff frequency of each filter is not a function of the filter order.    The filter order determines the steepness of the dropoff, the maximum attenuation, and the number of artifacts in the rejection band.

    0
     
    LVL 22

    Expert Comment

    by:grg99
    For example, for the same cutoff frequency,  an order 13 filter gives about 40 db attenuation in the stop band, a 26 order one gives about 80db attenuation.
    0
     
    LVL 3

    Expert Comment

    by:andYetAnotherLoginName
    grg99: perhaps by "cutoff" he mean freakuency, for which attenuation is more than <some-special-value-here> db?
    0
     
    LVL 22

    Expert Comment

    by:grg99
    Maybe!

    I suspect there is no simple formula for this.  I'd do a simple binary cut-and-try:  See if order 30 is good enough, if so, try 15, if not try 60, divide and conquer.  The applets I've used do each calculation in less than a second, so time is not a big issue.



    0
     
    LVL 3

    Expert Comment

    by:andYetAnotherLoginName
    that's virtually the same I have suggested :-P
    0
     
    LVL 22

    Expert Comment

    by:grg99
    You can't really interpolate from tables, as there are all kinds of oscillating cyclic peaks that vary depending on ALL the parameters.  If the curves of attenuation vs poles was monotonically increasing, you'd have a chance, but in general you don't and can't.

    it gets even worse with things like Tsybchev filters with nulls, these can get really wild.

    0
     

    Author Comment

    by:HorridMan
    Okay thanks. I'll just leave this question up a little while longer.
    0
     

    Author Comment

    by:HorridMan
     I am using the term cutoff frequency not to mean the lowest frequency that is attenuated, but the the frequency at which a given amount of attenuation (say 10% of the stopband attenuation) has occurred. That has always been the idea presented in textbooks I have read. But I'm 100% self taught, so forgive me if I sound like I'm out to lunch on this. But changing the filter order CERTAINLY DOES have an effect on which frequency is attenuated by a given amont. (I tested it again just now). I want to know how to work out what order will give provide users with the cutoff they specifiy with a known sampling rate.
    0
     
    LVL 3

    Expert Comment

    by:andYetAnotherLoginName
    That sounds like my guess. If "order" is an only varying parameter, use my suggestion, if no, grg99 way would be easier (you don't want to mess with multidimensional interpolation just to find your cutoff).
    0
     
    LVL 22

    Assisted Solution

    by:grg99
    Ok, we have a problem with terminoligy.

    Thee are two different parameters mixed up here:

    #1 is the "cutoff frequency", which is usually specified as the point where the response is down to half power (.707 voltage).

    #2 is the "attenuation slope", which is usually characterized as so many db per octave.

    Most of the design equations are set up so that #1 doesnt change with filter order, but of course #2 does.

    As noted before, there's probably no simple formula for this, if there was, it would be easier to design filters without all the fancy math and iteration.

     

    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    Finite Automata 10 32
    In-wall A/C question 9 195
    Tricky equity split scenario after house is sold 4 57
    Question of probability 6 53
    A Guide to the PMT, FV, IPMT and PPMT Functions In MS Excel we have the PMT, FV, IPMT and PPMT functions, which do a fantastic job for interest rate calculations.  But what if you don't have Excel ? This article is for programmers looking to re…
    Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
    This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    931 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now