DSPRelated.com
Forums

What is wrong in this IIR filter code?

Started by Ole December 5, 2006
The filter works very well now and very stable.

Thanks
Ole 


On Wed, 6 Dec 2006 12:47:37 +0100, "Ole" <ole@blabla.com> wrote:

>The filter works very well now and very stable. > >Thanks >Ole
Hi Ole, That's good news. I'm happy to hear it. Ole, I'm curious. What is the application for which you need such a super-narrow lowpass filter? Are you permitted to tell us? Thanks, [-Rick-]
"Ole" <ole@blabla.com> wrote in news:4576adda$0$13940
$edfadb0f@dread15.news.tele.dk:

> The filter works very well now and very stable. > > Thanks > Ole > >
What did it take to fix it? -- Scott Reverse name to reply

Rick Lyons wrote:

> Ole's tryin' to build a filter > whose cutoff freq is roughly Fs/1000 !!!
Not a big deal since it is in the double float precision. The coarse estimate for precision loss is Q*(Fs/Fc)^2, so the loss of 20 bits or so looks quite affordable.
> Isn't attempting to build such a "high-Q" filter > using a simple 2nd-order filter just askin' for trouble? > > That filter doesn't seem to be realistic. > Maybe Ole should perform some lowpass filtering > and decimation.
The code looks very unprofessional. Judging on that, the mistakes can be anywhere. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
It's not a lowpass filter but a highpass filter. The filter is used to 
simulate a sensor which characteristic follows a butterworth. and that has 
its 3 dB cutoff at the given frequency.

The error was loocated somewhere else in the code -  the Yn2 was assigned as 
Yn1 so the two parameters were the same. After correcting that problem the 
simulation work exactly as wanted.

Best regards
Ole 


Ole wrote:
> It's not a lowpass filter but a highpass filter. The filter is used to > simulate a sensor which characteristic follows a butterworth. and that has > its 3 dB cutoff at the given frequency. > > The error was loocated somewhere else in the code - the Yn2 was assigned as > Yn1 so the two parameters were the same. After correcting that problem the > simulation work exactly as wanted.
Will the actual device use as many bits as the simulation? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Vladimir Vassilevsky wrote:

> Not a big deal since it is in the double float precision. The > coarse estimate for precision loss is Q*(Fs/Fc)^2, so the loss > of 20 bits or so looks quite affordable.
Where can I read about the precision loss estimate, please? Martin -- Quidquid latine scriptum sit, altum viditur.

Martin Eisenberg wrote:
> Vladimir Vassilevsky wrote: > > >>Not a big deal since it is in the double float precision. The >>coarse estimate for precision loss is Q*(Fs/Fc)^2, so the loss >>of 20 bits or so looks quite affordable. > > > Where can I read about the precision loss estimate, please? >
Any good book on filters should have that, as well as the measures to improve the accuracy. I like this one: Dietrich Schlichtharle. Digital Filters: Basics and Design. Springer ISBN 3-540-66841-1 The basic idea is simple: in IIR, the quantization noise is multiplied by the closed loop gain of the feedback path. The exact numbers depend on the IIR structure, however if Fc is much lower then Fs, then we can assume: noise gain ~ Q(Fs/Fc)^2. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Martin Eisenberg wrote:
> Vladimir Vassilevsky wrote: > > >>Not a big deal since it is in the double float precision. The >>coarse estimate for precision loss is Q*(Fs/Fc)^2, so the loss >>of 20 bits or so looks quite affordable. > > > Where can I read about the precision loss estimate, please? >
Any good book on filters should have that, as well as the measures to improve the accuracy. I like this one: Dietrich Schlichtharle. Digital Filters: Basics and Design. Springer ISBN 3-540-66841-1 The basic idea is simple: in IIR, the quantization noise is multiplied by the closed loop gain of the feedback path. The exact numbers depend on the IIR structure, however if Fc is much lower then Fs, then we can assume: noise gain ~ Q(Fs/Fc)^2. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Martin Eisenberg wrote:
> Vladimir Vassilevsky wrote: > > >>Not a big deal since it is in the double float precision. The >>coarse estimate for precision loss is Q*(Fs/Fc)^2, so the loss >>of 20 bits or so looks quite affordable. > > > Where can I read about the precision loss estimate, please? >
Any good book on filters should have that, as well as the measures to improve the accuracy. I like this one: Dietrich Schlichtharle. Digital Filters: Basics and Design. Springer ISBN 3-540-66841-1 The basic idea is simple: in IIR, the quantization noise is multiplied by the closed loop gain of the feedback path. The exact numbers depend on the IIR structure, however if Fc is much lower then Fs, then we can assume: noise gain ~ Q(Fs/Fc)^2. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com