COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Converting IIR filter to different sample rates

• Email
• Follow

```Hi,

Is there a standard way of converting an IIR filter to a different sample
rate?

What I mean by this is, if I have an IIR filter F0 with a particular
frequency response at sample rate S0, and I want to create a filter F1 to
give, as near as possible, the same frequency response, at a different
sample rate S1, is there a standard way of calculating the coefficients of
F1 from F0?

My initial thoughts are that maybe I can find the zeroes and poles, and
then rotate them around the unit circle or something, but I suspect there
may be a standard solution to this problem?

Thanks for any help.

Paul

```
 0
Reply paul__tapper (1) 6/7/2010 12:18:02 PM

See related articles to this posting

```On 6/7/2010 8:18 AM, PaulTapper wrote:
> Hi,
>
> Is there a standard way of converting an IIR filter to a different sample
> rate?
>
> What I mean by this is, if I have an IIR filter F0 with a particular
> frequency response at sample rate S0, and I want to create a filter F1 to
> give, as near as possible, the same frequency response, at a different
> sample rate S1, is there a standard way of calculating the coefficients of
> F1 from F0?
>
> My initial thoughts are that maybe I can find the zeroes and poles, and
> then rotate them around the unit circle or something, but I suspect there
> may be a standard solution to this problem?

Why not design a new filter to the original response specs? Even if
there were a simple transformation, the prewarping would be wrong.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
```
 0
Reply Jerry 6/7/2010 1:03:27 PM

```On 7 Jun, 14:18, "PaulTapper" <paul__tapper@n_o_s_p_a_m.hotmail.com>
wrote:
> Hi,
>
> Is there a standard way of converting an IIR filter to a different sample
> rate?

No, there isn't. The normalized bandwidth is the main
design parameter for filters.

Suppose you want a LPF with passband 0-10 Hz. If the sampling
rate is low, say, 100 Hz, you will be able to achieve the goal
with a low-order filter.

If the sampling rate is high, say, 10kHz, you will need a far
higher filter order to meet the same spec.

Rune
```
 0
Reply Rune 6/7/2010 1:52:11 PM

```On Jun 7, 8:18=A0am, "PaulTapper" <paul__tapper@n_o_s_p_a_m.hotmail.com>
wrote:
> Hi,
>
> Is there a standard way of converting an IIR filter to a different sample
> rate?
>
> What I mean by this is, if I have an IIR filter F0 with a particular
> frequency response at sample rate S0, and I want to create a filter F1 to
> give, as near as possible, the same frequency response, at a different
> sample rate S1, is there a standard way of calculating the coefficients o=
f
> F1 from F0?
>
> My initial thoughts are that maybe I can find the zeroes and poles, and
> then rotate them around the unit circle or something, but I suspect there
> may be a standard solution to this problem?
>
> Thanks for any help.
>
> Paul

I'm with Jerry, on this one. Just redo the filter using your filter
design program. You may find that sometimes in order to meet spec, you
will have to increase the filter order.

Clay

```
 0
Reply clay (793) 6/7/2010 3:20:35 PM

```On Jun 7, 11:20=A0am, Clay <c...@claysturner.com> wrote:
> On Jun 7, 8:18=A0am, "PaulTapper" <paul__tapper@n_o_s_p_a_m.hotmail.com>
> wrote:
>
>
>
> > Hi,
>
> > Is there a standard way of converting an IIR filter to a different samp=
le
> > rate?
>
> > What I mean by this is, if I have an IIR filter F0 with a particular
> > frequency response at sample rate S0, and I want to create a filter F1 =
to
> > give, as near as possible, the same frequency response, at a different
> > sample rate S1, is there a standard way of calculating the coefficients=
of
> > F1 from F0?
>
> > My initial thoughts are that maybe I can find the zeroes and poles, and
> > then rotate them around the unit circle or something, but I suspect the=
re
> > may be a standard solution to this problem?
>
> > Thanks for any help.
>
> I'm with Jerry, on this one. Just redo the filter using your filter
> design program. You may find that sometimes in order to meet spec, you
> will have to increase the filter order.

i'm with Clay and Rune and Jerry also.  but if all of the "action" in
your filter (all of the resonant frequencies) are much much lower than
Nyquist, then the answer is "sorta yes".  think of an analog filter as
a sorta digital filter with Nyquist bumped up to infinity.  then all
of the resonant action *is* happening far below Nyquist and we know
how to simply scale s-plane coefficients in an analog filter to move
the frequency response around.  so you can use a mapping like bilinear
transform to map your digital to analog, then scale the s-plane
coefficients in the simplistic manner, then map s-plane back to the z-
plane.  but if you are reducing the sample rate, then you are pushing
the resonant action up toward Nyquist and then the approximations we
use that it's all far below Nyquist no longer apply.

r b-j

you can map an analo
```
 0
Reply robert 6/7/2010 3:44:42 PM

```
Jerry Avins wrote:
> On 6/7/2010 8:18 AM, PaulTapper wrote:
>
>> Hi,
>>
>> Is there a standard way of converting an IIR filter to a different sample
>> rate?
>>
>> What I mean by this is, if I have an IIR filter F0 with a particular
>> frequency response at sample rate S0, and I want to create a filter F1 to
>> give, as near as possible, the same frequency response, at a different
>> sample rate S1, is there a standard way of calculating the
>> coefficients of
>> F1 from F0?
>>
>> My initial thoughts are that maybe I can find the zeroes and poles, and
>> then rotate them around the unit circle or something, but I suspect there
>> may be a standard solution to this problem?
>
>
> Why not design a new filter to the original response specs? Even if
> there were a simple transformation, the prewarping would be wrong.

The problem stated by OP is quite common. Of course, it is possible to
design a filter to a new sample rate from scratch. However this implies
pretty extensive floating point math with libraries which could be too
heavy for the target hardware. If this is a case, I prefer interpolation
between the sets of coefficients.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com
```
 0

```On Jun 7, 5:18=A0am, "PaulTapper" <paul__tapper@n_o_s_p_a_m.hotmail.com>
wrote:
> Hi,
>
> Is there a standard way of converting an IIR filter to a different sample
> rate?
>
> What I mean by this is, if I have an IIR filter F0 with a particular
> frequency response at sample rate S0, and I want to create a filter F1 to
> give, as near as possible, the same frequency response, at a different
> sample rate S1, is there a standard way of calculating the coefficients o=
f
> F1 from F0?
>
> My initial thoughts are that maybe I can find the zeroes and poles, and
> then rotate them around the unit circle or something, but I suspect there
> may be a standard solution to this problem?
>
> Thanks for any help.
>
> Paul
I just posted a similar question
I am not able to work on the solution now but I will next week.   I
tried use an inverse Tustin's to s domain and then Tustin's to z
domain but that was not very accurate.  It was accurate to about 3
decimal places. The Tustin's approximation also introduced zeros that
weren't there before. Not good.  I also have an offset that you may
not have.  When I am able I will look into using the inverse matched z
transforms and match z transforms.  This problem seems to have stump
this news group.

How many terms do you have in your IIR filter?  I may be able to help
with something simple but at this time I don't have a general
solution.  There may not be a general solution.  I do know I can wok
out a solution for a specific case given time using the same
techniques I used for the simple first order IIR in my pdf files.

Peter Nachtwey
```
 0
Reply pnachtwey (92) 6/8/2010 1:57:25 AM

```On 6/7/2010 8:52 PM, Vladimir Vassilevsky wrote:
>
>
> Jerry Avins wrote:
>> On 6/7/2010 8:18 AM, PaulTapper wrote:
>>
>>> Hi,
>>>
>>> Is there a standard way of converting an IIR filter to a different
>>> sample
>>> rate?
>>>
>>> What I mean by this is, if I have an IIR filter F0 with a particular
>>> frequency response at sample rate S0, and I want to create a filter
>>> F1 to
>>> give, as near as possible, the same frequency response, at a different
>>> sample rate S1, is there a standard way of calculating the
>>> coefficients of
>>> F1 from F0?
>>>
>>> My initial thoughts are that maybe I can find the zeroes and poles, and
>>> then rotate them around the unit circle or something, but I suspect
>>> there
>>> may be a standard solution to this problem?
>>
>>
>> Why not design a new filter to the original response specs? Even if
>> there were a simple transformation, the prewarping would be wrong.
>
> The problem stated by OP is quite common. Of course, it is possible to
> design a filter to a new sample rate from scratch. However this implies
> pretty extensive floating point math with libraries which could be too
> heavy for the target hardware. If this is a case, I prefer interpolation
> between the sets of coefficients.

Had the OP written that he needs to design his filter on target
hardware, the suggestions would have been different. A program's needing
to adapt to a new sample rate it couldn't anticipate must be rather rare.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
```
 0
Reply jya (12872) 6/8/2010 2:04:38 AM

```On 06/07/2010 06:57 PM, pnachtwey wrote:
> On Jun 7, 5:18 am, "PaulTapper"<paul__tapper@n_o_s_p_a_m.hotmail.com>
> wrote:
>> Hi,
>>
>> Is there a standard way of converting an IIR filter to a different sample
>> rate?
>>
>> What I mean by this is, if I have an IIR filter F0 with a particular
>> frequency response at sample rate S0, and I want to create a filter F1 to
>> give, as near as possible, the same frequency response, at a different
>> sample rate S1, is there a standard way of calculating the coefficients of
>> F1 from F0?
>>
>> My initial thoughts are that maybe I can find the zeroes and poles, and
>> then rotate them around the unit circle or something, but I suspect there
>> may be a standard solution to this problem?
>>
>> Thanks for any help.
>>
>> Paul
> I just posted a similar question
> I am not able to work on the solution now but I will next week.   I
> tried use an inverse Tustin's to s domain and then Tustin's to z
> domain but that was not very accurate.  It was accurate to about 3
> decimal places. The Tustin's approximation also introduced zeros that
> weren't there before. Not good.  I also have an offset that you may
> not have.  When I am able I will look into using the inverse matched z
> transforms and match z transforms.  This problem seems to have stump
> this news group.
>
> How many terms do you have in your IIR filter?  I may be able to help
> with something simple but at this time I don't have a general
> solution.  There may not be a general solution.  I do know I can wok
> out a solution for a specific case given time using the same
> techniques I used for the simple first order IIR in my pdf files.

Well, I wouldn't say that I'm stumped per se, just that I don't have the
information at my fingertips and -- much as I think you're a cool guy --
I'm not willing to work it all out for free.  I think it's a very
solvable problem, however.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```
 0
Reply Tim 6/8/2010 3:27:30 AM

```On 08-06-2010 at 02:52:13 Vladimir Vassilevsky <nospam@nowhere.com> wrote:

> The problem stated by OP is quite common. Of course, it is possible to
> design a filter to a new sample rate from scratch. However this implies
> pretty extensive floating point math with libraries which could be too
> heavy for the target hardware. If this is a case, I prefer interpolation
> between the sets of coefficients.
>
>
> DSP and Mixed Signal Design Consultant
> http://www.abvolt.com

Entry: resampling.
Am I right?

--
Mikolaj
```
 0
Reply Mikolaj 6/8/2010 6:03:22 AM

```On 8 Jun, 02:52, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> Jerry Avins wrote:
> > On 6/7/2010 8:18 AM, PaulTapper wrote:
>
> >> Hi,
>
> >> Is there a standard way of converting an IIR filter to a different sample
> >> rate?
>
> >> What I mean by this is, if I have an IIR filter F0 with a particular
> >> frequency response at sample rate S0, and I want to create a filter F1 to
> >> give, as near as possible, the same frequency response, at a different
> >> sample rate S1, is there a standard way of calculating the
> >> coefficients of
> >> F1 from F0?
>
> >> My initial thoughts are that maybe I can find the zeroes and poles, and
> >> then rotate them around the unit circle or something, but I suspect there
> >> may be a standard solution to this problem?
>
> > Why not design a new filter to the original response specs? Even if
> > there were a simple transformation, the prewarping would be wrong.
>
> The problem stated by OP is quite common. Of course, it is possible to
> design a filter to a new sample rate from scratch. However this implies
> pretty extensive floating point math with libraries which could be too
> heavy for the target hardware.

Would one do filter *design* with scarce computational
resources? I think of design as something done once up
front, on a PC, and then the coefficints might be
downloaded to whatever device that would actually run
the filter.

> If this is a case, I prefer interpolation
> between the sets of coefficients.

Sure. With FIRs this would be possible. But IIRs?

Rune
```
 0
Reply Rune 6/8/2010 8:18:27 AM

```On Jun 7, 8:27=A0pm, Tim Wescott <t...@seemywebsite.now> wrote:
> On 06/07/2010 06:57 PM, pnachtwey wrote:
>
>
>
> > On Jun 7, 5:18 am, "PaulTapper"<paul__tapper@n_o_s_p_a_m.hotmail.com>
> > wrote:
> >> Hi,
>
> >> Is there a standard way of converting an IIR filter to a different sam=
ple
> >> rate?
>
> >> What I mean by this is, if I have an IIR filter F0 with a particular
> >> frequency response at sample rate S0, and I want to create a filter F1=
to
> >> give, as near as possible, the same frequency response, at a different
> >> sample rate S1, is there a standard way of calculating the coefficient=
s of
> >> F1 from F0?
>
> >> My initial thoughts are that maybe I can find the zeroes and poles, an=
d
> >> then rotate them around the unit circle or something, but I suspect th=
ere
> >> may be a standard solution to this problem?
>
> >> Thanks for any help.
>
> >> Paul
> > I just posted a similar question
> > I am not able to work on the solution now but I will next week. =A0 I
> > tried use an inverse Tustin's to s domain and then Tustin's to z
> > domain but that was not very accurate. =A0It was accurate to about 3
> > decimal places. The Tustin's approximation also introduced zeros that
> > weren't there before. Not good. =A0I also have an offset that you may
> > not have. =A0When I am able I will look into using the inverse matched =
z
> > transforms and match z transforms. =A0This problem seems to have stump
> > this news group.
>
> > How many terms do you have in your IIR filter? =A0I may be able to help
> > with something simple but at this time I don't have a general
> > solution. =A0There may not be a general solution. =A0I do know I can wo=
k
> > out a solution for a specific case given time using the same
> > techniques I used for the simple first order IIR in my pdf files.
>
> Well, I wouldn't say that I'm stumped per se, just that I don't have the
> information at my fingertips and -- much as I think you're a cool guy --
> I'm not willing to work it all out for free. =A0I think it's a very
> solvable problem, however.
>
> --
> Tim Wescott
> Control system and signal processing consultingwww.wescottdesign.com
The problem is solvable but the point is there isn't a well known
algorithm that makes it easy for me or PaulTrapper.  It well take some
symbolic manipulation.

Peter Nachtwey
```
 0
Reply pnachtwey (92) 6/8/2010 12:01:55 PM

```Hi, and thank you all for your responses.

My specific application is a software implementation, not hardware, in a
context where the sample rate is unknown at the outset (although it is very
likely to be within the range of 11kHz to 96kHz).

The filters I'm interested in are Biquads, so pretty simple.  One HPF and
one high shelf.  I have the coefficients for the desired frequency response
at one specific sample rate, and want to be able to generate a biquad with
similar freq response for a given sample rate at run-time.

The converting to S-plane, and then back again idea sounds promising.  I'll
need to brush up my dsp theory a bit I think.

Thanks again everyone.

Paul
```
 0
Reply PaulTapper 6/8/2010 12:41:27 PM

```On 6/8/2010 8:41 AM, PaulTapper wrote:
> Hi, and thank you all for your responses.
>
> My specific application is a software implementation, not hardware, in a
> context where the sample rate is unknown at the outset (although it is very
> likely to be within the range of 11kHz to 96kHz).
>
> The filters I'm interested in are Biquads, so pretty simple.  One HPF and
> one high shelf.  I have the coefficients for the desired frequency response
> at one specific sample rate, and want to be able to generate a biquad with
> similar freq response for a given sample rate at run-time.
>
> The converting to S-plane, and then back again idea sounds promising.  I'll
> need to brush up my dsp theory a bit I think.

If you want to do this at run time on an embedded processor, I think a
good way would te to store coefficients for a number of sample rates and
interpolate between them, as Vladimir suggested.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
```
 0
Reply Jerry 6/8/2010 1:58:42 PM

```
Rune Allnor wrote:
> On 8 Jun, 02:52, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
>
>>Jerry Avins wrote:
>>
>>>On 6/7/2010 8:18 AM, PaulTapper wrote:
>>
>>>>Hi,
>>
>>>>Is there a standard way of converting an IIR filter to a different sample
>>>>rate?
>>
>>>>What I mean by this is, if I have an IIR filter F0 with a particular
>>>>frequency response at sample rate S0, and I want to create a filter F1 to
>>>>give, as near as possible, the same frequency response, at a different
>>>>sample rate S1, is there a standard way of calculating the
>>>>coefficients of
>>>>F1 from F0?
>>
>>>>My initial thoughts are that maybe I can find the zeroes and poles, and
>>>>then rotate them around the unit circle or something, but I suspect there
>>>>may be a standard solution to this problem?
>>
>>>Why not design a new filter to the original response specs? Even if
>>>there were a simple transformation, the prewarping would be wrong.
>>
>>The problem stated by OP is quite common. Of course, it is possible to
>>design a filter to a new sample rate from scratch. However this implies
>>pretty extensive floating point math with libraries which could be too
>>heavy for the target hardware.
>
>
> Would one do filter *design* with scarce computational
> resources? I think of design as something done once up
> front, on a PC, and then the coefficints might be
> downloaded to whatever device that would actually run
> the filter.

There are many application where users can enter arbitrary parameters.
Ranging from digital oscilloscopes to audio processing.
Once I did filter design in a fixed point on machine with 4k memory; I
won't like to do it again.

>>If this is a case, I prefer interpolation
>>between the sets of coefficients.
>
>
> Sure. With FIRs this would be possible. But IIRs?

With IIRs, store precalculated sets and interpolate between them.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com
```
 0

```On Jun 8, 8:41=A0am, "PaulTapper" <paul__tapper@n_o_s_p_a_m.hotmail.com>
wrote:
> Hi, and thank you all for your responses.
>
> My specific application is a software implementation, not hardware, in a
> context where the sample rate is unknown at the outset (although it is ve=
ry
> likely to be within the range of 11kHz to 96kHz).
>
> The filters I'm interested in are Biquads, so pretty simple. =A0One HPF a=
nd
> one high shelf. =A0I have the coefficients for the desired frequency resp=
onse
> at one specific sample rate, and want to be able to generate a biquad wit=
h
> similar freq response for a given sample rate at run-time.
>
> The converting to S-plane, and then back again idea sounds promising.

and totally unnecessary, if what you're doing is designing biquads of
a "standard" shape for different sampling frequencies.

did you know about the Audio Eq Cookbook?  it seems to me to be the
simplest, quickest means to get the coefficients you want for a
variety of sample rates.  dunno what your platform is, but you can
probably compute the coefficients on the fly.

r b-j
```
 0
Reply robert 6/8/2010 3:51:22 PM

```On 6/8/2010 1:18 AM, Rune Allnor wrote:
> On 8 Jun, 02:52, Vladimir Vassilevsky<nos...@nowhere.com>  wrote:
>> Jerry Avins wrote:
>>> On 6/7/2010 8:18 AM, PaulTapper wrote:
>>
>>>> Hi,
>>
>>>> Is there a standard way of converting an IIR filter to a different sample
>>>> rate?
>>
>>>> What I mean by this is, if I have an IIR filter F0 with a particular
>>>> frequency response at sample rate S0, and I want to create a filter F1 to
>>>> give, as near as possible, the same frequency response, at a different
>>>> sample rate S1, is there a standard way of calculating the
>>>> coefficients of
>>>> F1 from F0?
>>
>>>> My initial thoughts are that maybe I can find the zeroes and poles, and
>>>> then rotate them around the unit circle or something, but I suspect there
>>>> may be a standard solution to this problem?
>>
>>> Why not design a new filter to the original response specs? Even if
>>> there were a simple transformation, the prewarping would be wrong.
>>
>> The problem stated by OP is quite common. Of course, it is possible to
>> design a filter to a new sample rate from scratch. However this implies
>> pretty extensive floating point math with libraries which could be too
>> heavy for the target hardware.
>
> Would one do filter *design* with scarce computational
> resources? I think of design as something done once up
> front, on a PC, and then the coefficints might be
> downloaded to whatever device that would actually run
> the filter.
>
>> If this is a case, I prefer interpolation
>> between the sets of coefficients.
>
> Sure. With FIRs this would be possible. But IIRs?
>
> Rune

Not sure if you could interpolate the coefficients, but you could at
least interpolate the poles, then throw some quick math at it to turn

If you've got two different, stable, IIR filters, both have their poles
entirely inside the unit circle.  The line connecting them, representing
the set of all possible interpolations, also has to be entirely inside
the unit circle.  If you interpolate it in Cartesian coordinates you'd
probably want a pretty fine set of choices to pick through in order to
keep from getting too far towards the center, but with a radial
interpolation you could probably do the OPs required span on 3, maybe 4
templates.

--
Rob Gaddi, Highland Technology
Email address is currently out of order
```
 0

```On 06/08/2010 01:18 AM, Rune Allnor wrote:
> On 8 Jun, 02:52, Vladimir Vassilevsky<nos...@nowhere.com>  wrote:
>> Jerry Avins wrote:
>>> On 6/7/2010 8:18 AM, PaulTapper wrote:
>>
>>>> Hi,
>>
>>>> Is there a standard way of converting an IIR filter to a different sample
>>>> rate?
>>
>>>> What I mean by this is, if I have an IIR filter F0 with a particular
>>>> frequency response at sample rate S0, and I want to create a filter F1 to
>>>> give, as near as possible, the same frequency response, at a different
>>>> sample rate S1, is there a standard way of calculating the
>>>> coefficients of
>>>> F1 from F0?
>>
>>>> My initial thoughts are that maybe I can find the zeroes and poles, and
>>>> then rotate them around the unit circle or something, but I suspect there
>>>> may be a standard solution to this problem?
>>
>>> Why not design a new filter to the original response specs? Even if
>>> there were a simple transformation, the prewarping would be wrong.
>>
>> The problem stated by OP is quite common. Of course, it is possible to
>> design a filter to a new sample rate from scratch. However this implies
>> pretty extensive floating point math with libraries which could be too
>> heavy for the target hardware.
>
> Would one do filter *design* with scarce computational
> resources? I think of design as something done once up
> front, on a PC, and then the coefficints might be
> downloaded to whatever device that would actually run
> the filter.
>
>> If this is a case, I prefer interpolation
>> between the sets of coefficients.
>
> Sure. With FIRs this would be possible. But IIRs?

Why not?  You'd have to make sure that you had enough sets so that the
interpolation would always cough up a good filter, but it should work.

You could probably increase the stride size of your tables if you stored
the filter coefficients as complex pole values, then interpolated those
pole positions.  Going from a complex pole pair to an IIR filter doesn't
take anything heavier than multiplication and addition; a tool set that
doesn't have floating point math for that is pretty lame.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```
 0
Reply Tim 6/8/2010 4:57:07 PM

```On 8 Jun, 18:35, Rob Gaddi <rga...@technologyhighland.com> wrote:
> On 6/8/2010 1:18 AM, Rune Allnor wrote:
>
>
>
>
>
> > On 8 Jun, 02:52, Vladimir Vassilevsky<nos...@nowhere.com> =A0wrote:
> >> Jerry Avins wrote:
> >>> On 6/7/2010 8:18 AM, PaulTapper wrote:
>
> >>>> Hi,
>
> >>>> Is there a standard way of converting an IIR filter to a different s=
ample
> >>>> rate?
>
> >>>> What I mean by this is, if I have an IIR filter F0 with a particular
> >>>> frequency response at sample rate S0, and I want to create a filter =
F1 to
> >>>> give, as near as possible, the same frequency response, at a differe=
nt
> >>>> sample rate S1, is there a standard way of calculating the
> >>>> coefficients of
> >>>> F1 from F0?
>
> >>>> My initial thoughts are that maybe I can find the zeroes and poles, =
and
> >>>> then rotate them around the unit circle or something, but I suspect =
there
> >>>> may be a standard solution to this problem?
>
> >>> Why not design a new filter to the original response specs? Even if
> >>> there were a simple transformation, the prewarping would be wrong.
>
> >> The problem stated by OP is quite common. Of course, it is possible to
> >> design a filter to a new sample rate from scratch. However this implie=
s
> >> pretty extensive floating point math with libraries which could be too
> >> heavy for the target hardware.
>
> > Would one do filter *design* with scarce computational
> > resources? I think of design as something done once up
> > front, on a PC, and then the coefficints might be
> > downloaded to whatever device that would actually run
> > the filter.
>
> >> If this is a case, I prefer interpolation
> >> between the sets of coefficients.
>
> > Sure. With FIRs this would be possible. But IIRs?
>
> > Rune
>
> Not sure if you could interpolate the coefficients, but you could at
> least interpolate the poles, then throw some quick math at it to turn
> them into biquads.

Still don't see how this would work. Could you sketch an
example?

Rune
```
 0
Reply Rune 6/10/2010 9:37:05 AM

```On 8 Jun., 14:41, "PaulTapper" wrote:
>
> My specific application is a software implementation, not hardware, in a
> context where the sample rate is unknown at the outset (although it is ve=
ry
> likely to be within the range of 11kHz to 96kHz).
>
> The filters I'm interested in are Biquads, so pretty simple. One HPF and
> one high shelf. =A0I have the coefficients for the desired frequency resp=
onse
> at one specific sample rate, and want to be able to generate a biquad wit=
h
> similar freq response for a given sample rate at run-time.

This could be done via "frequency warping".  Assume you have a biquad
H given
as
b0 + b1 z^-1 + b2
H(z) =3D -----------------
1  + a1 z^-1 + a2

which does something "interesting" with a "corner frequency" f in
radian (i.e. -3dB cutoff frequency or the resonance frequency, etc).
Then by replacing z^-1 with a simple all-pass of the form

p +   z^-1
A(z) =3D ----------
1 + p z^-1

in H(z) you will get another biquad H(A(z)) where the corner frequency
has moved up or down depending on the warping parameter p.  I don't
recall the exact relationship between f, p and the resulting "corner
frequency" f'.  But it's a fairly simple relationship if I remember
correctly.  It should be easy to compute p in a way so that new new
filter's "corner frequency" is where you want it to be:

// returns the frequency warping parameter so that
// the cutoff frequency / resonance frequency / whatever
// moves from freq_rad1 to freq_rad2 ...

So, in case you have a lowpass filter with a cutoff frequency of 10 Hz
for a smapling rate of 100 Hz and you want a similar filter for 120 Hz
you'd use

and use the to-be-implemented function from above to compute p and
alter your coefficients b0,b1,b2 and a1,a2 according to p.

I actually used something like this to adapt an ATH-based noise
shaping filter to different sampling rates (in a limited range like
32-48 kHz) where I simply set f so it corresponds to around 4 kHz.
It's not perfect, but it works.  At low frequencies you have a nearly
linear scaling effect.  Around around Nyquist/2 the magnitude response
just moves up or down and doesn't really expand or narrow.

Cheers!
SG
```
 0
Reply SG 6/10/2010 5:06:40 PM

```On 6/10/2010 2:37 AM, Rune Allnor wrote:
> On 8 Jun, 18:35, Rob Gaddi<rga...@technologyhighland.com>  wrote:
>> On 6/8/2010 1:18 AM, Rune Allnor wrote:
>>
>>
>>
>>
>>
>>> On 8 Jun, 02:52, Vladimir Vassilevsky<nos...@nowhere.com>    wrote:
>>>> Jerry Avins wrote:
>>>>> On 6/7/2010 8:18 AM, PaulTapper wrote:
>>
>>>>>> Hi,
>>
>>>>>> Is there a standard way of converting an IIR filter to a different sample
>>>>>> rate?
>>
>>>>>> What I mean by this is, if I have an IIR filter F0 with a particular
>>>>>> frequency response at sample rate S0, and I want to create a filter F1 to
>>>>>> give, as near as possible, the same frequency response, at a different
>>>>>> sample rate S1, is there a standard way of calculating the
>>>>>> coefficients of
>>>>>> F1 from F0?
>>
>>>>>> My initial thoughts are that maybe I can find the zeroes and poles, and
>>>>>> then rotate them around the unit circle or something, but I suspect there
>>>>>> may be a standard solution to this problem?
>>
>>>>> Why not design a new filter to the original response specs? Even if
>>>>> there were a simple transformation, the prewarping would be wrong.
>>
>>>> The problem stated by OP is quite common. Of course, it is possible to
>>>> design a filter to a new sample rate from scratch. However this implies
>>>> pretty extensive floating point math with libraries which could be too
>>>> heavy for the target hardware.
>>
>>> Would one do filter *design* with scarce computational
>>> resources? I think of design as something done once up
>>> front, on a PC, and then the coefficints might be
>>> downloaded to whatever device that would actually run
>>> the filter.
>>
>>>> If this is a case, I prefer interpolation
>>>> between the sets of coefficients.
>>
>>> Sure. With FIRs this would be possible. But IIRs?
>>
>>> Rune
>>
>> Not sure if you could interpolate the coefficients, but you could at
>> least interpolate the poles, then throw some quick math at it to turn
>> them into biquads.
>
> Still don't see how this would work. Could you sketch an
> example?
>
> Rune

The interpolation between the poles (P' = P1*a + P2*(1-a) for P = [R
theta]), or turning pole pairs into biquad coefficients?

--
Rob Gaddi, Highland Technology
Email address is currently out of order
```
 0