DSPRelated.com
Forums

Scaling FIR for samplerate

Started by jeff227 December 7, 2006

jeff227 wrote:

>>1. Compute the FIR to the highest sample rate you need. >>2. If you want to recalculate the filter to the different sample rate, >>interpolate the coefficients in the time domain so the impulse response >>will look same. > > > > Thank you, but it looks like even that approach requires an "adaptive" > array length (proportional to samplerate) and some carefully designed > interpolation code.
Well, if it is a problem, you'd better think of a different occupation.
> Yuck. My "simple" problem seems to be getting worse.
BTW, you didn't tell what the problem is. What are you trying to achieve as the result? I can't use IIR
> because of the excessive ringing and phase shifts.
What in the particular is wrong with ringing and phase shift? If I use FIR I need
> multiple filters and delay lines for every possible samplerate.
Every possible rate? I thought you are considering the standard sample rates like 44.1, 48, 96, etc. There are only several rates of interest.
> There are numerous audio editors and VST/DirectX plugins available that > use FIRs and work at any samplerate (including odd rates). HOW ARE THEY > DOING THAT?!?
Design of a filter is pretty trivial and standard task. > Any ideas appreciated! Did you try to read any books? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Rune Allnor wrote:

> jeff227 skrev: > >>Sorry for the "DSP 101" questions but I'm a newbie... >> >>Is there a way to scale FIR filter coefficients so I can have the same >>cutoff and transition bandwidth regardless of sample rate (provided the >>sample rate is always within Nyquist limits)? > >>I am designing an audio processor that needs to have the same filter >>response regardless of user-selected sample rate (44.1KHz, 48KHz, 96KHz, >>etc.). >> >>How would one accomplish this with FIR filters? >
You could resample the impulse response (the function depicted by the coefficients) to obtain the new filter coefficients at the new sample rate. You'll end up with different filter lengths depending on the sample rate, and a different set of coefficients for each, but with the same (but resampled) impulse response. This is basically what happens with a polyphase resampler. So, while the coefficients and filter length depend on the sample rate, it isn't technically a clean sheet design for each sample rate.
Ray Andraka wrote:


> > You could resample the impulse response (the function depicted by the > coefficients) to obtain the new filter coefficients at the new sample > rate. You'll end up with different filter lengths depending on the > sample rate, and a different set of coefficients for each, but with the > same (but resampled) impulse response. This is basically what happens > with a polyphase resampler. So, while the coefficients and filter > length depend on the sample rate, it isn't technically a clean sheet > design for each sample rate.
Furthermore, you can generate the filter coefficients on the fly by interpolating from a master table containing the impulse response sampled at some arbitrary rate. Alternatively, you can resample to a common rate and then filter, although that is a little redundant since a resampler is also a filter, and by being clever you can fold your desired filter into the resampler.
>Did you try to read any books?
If you are annoyed by my questions why did you bother responding?

jeff227 wrote:

>>Did you try to read any books? > > > > If you are annoyed by my questions why did you bother responding?
Is it a new way to say "thank you for the valuable suggestions" ? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
>Vladimir Vassilevsky
>Design of a filter is pretty trivial and standard task.
Really? Guess all these discussions and textbooks are just for fun, eh?

jeff227 wrote:

>>Vladimir Vassilevsky > > >>Design of a filter is pretty trivial and standard task. > > > > Really?
Indeed. Let's make a bet for $1000 that I will do your freaking bibifilter in one day. Guess all these discussions and textbooks are just for fun, eh? Mostly a clueless people like you who never open a textbook are participating in those discussions. VLV
jeff227 skrev:
> >Vladimir Vassilevsky > > >Design of a filter is pretty trivial and standard task. > > > Really?
Yes.
> Guess all these discussions and textbooks are just for fun, eh?
No. Everything in life -- including filter design -- has to be learned. And as with everything else, learning filter design does require a little bit of effort from the student. That *you* are not able to do it yet, does not mean that filter design is one of those insurmountable tasks, like finding a cure for the common cold, that humankind is faced with. Rune