very short group delay low pass filter: how to choose?

hi,

i'm a newcomer to filter things and i'm not an engineer (i'm a software developer) so... don't be too harsh to me ;-)

the problem is: i have to use a low-pass filter (if it matters: digital, must run on a 32-bit machine using only integers)

right now i'm using a 4-pole butterworth; experimenting a bit i see, with a cutoff frequency around 100 hz, a delay of about 0.008 secs, which i would like to make shorter.

i'm no filter expert and basically i don't know where to go; i was lurking this group with ggroups and if i understand correctly there's some relation between group delay and filter response sharpness.

what can i do (change type or form of the filter, ...) to have a filter with short delays and (lower priority if i have to choose....) have a sharp response?

i would like to know if i have some grade of freedom besides lowering the pole count....

thank you a lot

gst (novice)

Reply to
gst
Loading thread data ...

In article , gst wrote: [....]

Is the 100Hz cut off a requirement? Obviously moving the cut off frequency up shortens the delay.

Why are you caring about "group delay"? A fairly common reason is that you intend this to be part of a control loop. In control loops it is usually best to look at the entire system's responce and not get hung up on some small part.

Why are you using a 4-pole filter? A single RC is a filter too. More poles makes for more delay.

You may simply be trying to do the imposible. A low pass filter uses data from the past. Anything you do that sharpens it or lowers its cut-off, the further into the past it must look.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

There is a fundamental trade-off between cut-off frequency, steepness and delay. The lower the cut-off frequency and the steeper the filter, the longer the delay. You can't escape that.

That said, in digital filters, it's easy to make things worse than they need to be. Don't use pipeline delays unless unavoidable. Don't use linear-phase FIR filters. If you can code a four-pole IIR algorithm without running into accuracy or overflow problems, fine. Otherwise code it as two two-pole sections. Don't get hung-up on Butterworth. Tweak the poles to trade off steepness against delay, for example.

Jeroen Belleman

Reply to
Jeroen Belleman

gst

The shortest delay has a filter with "minimum phase" design. You do not need to lower the pole count, but the Q-factor, which determines how fast the transition between pass- and stopband is. If you just need a certain suppression at a much higher nyquist frequency, you can use maybe a 6-pole Q=0.5 Gauss-filter. A 4-pole 100Hz(-3dB) butterworth filter has a Q of 0.707, but will need

4.5ms delay (0-50% of stationary value). A 6-pole Gauss will only need 3.16ms. Also this filter has no overshoot compared to 10.8% of the BW. The Bessel-filters are in-between with Q=0.58. A 6-pole Bessel has 4.28ms delay and 0.64% overshoot. A minimum phase filter is simply the unmirrored pulse response as a FIR, but there are ways of using an IIR as well.
--
ciao Ban
Apricale, Italy
Reply to
Ban

first question is...

do you really mean minimum group delay as in absolute delay....

or do you mean

min group delay __variation__ across the passband

they are two different things and there are two different answers depending upon which your question really is...

Mark

Reply to
Mark

There is, in theory, such a thing as an ideal lowpass transformer, absolutely unity transfer function for all frequencies below cutoff, zero above. It's not physically realizable, bacause it violates causality... its impulse response output begins before its input. If you're willing to allow some insertion delay you can fix the causality crisis, and then you can approximate it as closely as you like within financial limits.

As a practical matter, you can design a steeper-than-Bessel and follow it with allpass equalizer things to repair the delay wiggles. And there are "transitional" filters that are Bessel-like until some way out into the stopband, then drop harder, a compromise.

OP needs a good filter book or three.

John

Reply to
John Larkin

Zverev is the best I know about--but the used bookstore gold rush has run him up to about $350 a copy. (And you complain about me. ;-)

He has a nice equiripple group delay filter that's significantly sharper than a Bessel for the same maximum delta delay. It's also equiripple way out into the stopband, whereas Bessel and Gauss and all those other

19th century folks tend to lose their nice properties before the rolloff has a chance to cover their misdeeds.

Cheers,

Phil "not Australian" Hobbs

Reply to
Phil Hobbs

Oh dear! It's time to lock mine up then. It's getting precious.

Jeroen Belleman

Reply to
Jeroen Belleman

LOL!

Don't worry Phil, there's no possible confusion there. Not even the begining of an insult and way too much technical info there :-)

--
Thanks,
Fred.
Reply to
Fred Bartoli

ahem.... as you may have suspected i'm not sure 8-)

i'll try to explain my needs using plain old... italianish

i have this signal, unfortunately extremely noisy above 100hz (maybe i'll be forced to cut even at lower frequency, something like 80,

70...)

the signal is (at this point) enormously oversampled (3khz)

the system must react in a *very* short time to some "event" (thus i'm not doing things like cleaning signal for audio processing, i'm instead trying to react quickly to an anomaly)

the post-filter part is already quite tuned and very very fast, it's faster than sampling indeed...

thus i think the latency is The Real Enemy, and it comes basically from the filter....

thus:

what i need is to "copy" the good part of the signal from input to output as fast as possible while (lower priority) retaining as much strong attenuation in the "dirty" band part as possible.

the frequency components of the "good" part is unfortunately quite homogeneous, in theory i should retain 10hz as much as 70 hz....

....cheers and thanks from italy ;-)

Reply to
gst

The Gaussian filter is the mathematical optimum for least rise time with a given rolloff. A titorial can be found here:

formatting link

Reply to
Fred Bloggs

Rumour has it that it's also available in paperback ;-)

The equi-ripple constant group delay filters are also tabled in "HF filter design and computer simulation" by Randall W Rhea, McGraw-Hill.

There's also a slightly more recent optimsation method which can be made to give equi-ripple group delay, detailed in

B J Bennet "A new filter synthesis technique – the hourglass." IEEE Transactions CAS, 35(12):1469 – 1477, December 1988.

Best Regards

Jens

--
    Key ID 0x09723C12, jensting@tingleff.org
        Analogue filtering / 5GHz RLAN / Mdk Linux / odds and ends
 Click to see the full signature
Reply to
Jens Tingleff

give

Noble publishes Filtering in the Time and Frequency Domains, which is much more relevant than an archaic handbook of tabulations from the slide rule days.

Reply to
Fred Bloggs

I've purchased *three* copies of your damned addictive book so far. One for work, one for home, and one I was dumb enough to lend to somebody.

Williams' book includes equiripple delay filters, and costs below $100 used, from Amazon or Alibris. But if you're digital filtering, can't you go way beyond the classic forms?

John

Reply to
John Larkin

Ok... You can sometimes get much, much better results if you ignore the filter, and deal with the signal. Are you trying to monitor a changing frequency, amplitude, phase, ...?

Reply to
Ian Stirling

[Only seeing part of this thread as ISP has dropped all newsgroups, so ignore if post has been answered]. Poking around in a filter prog' turns up a IIR, 3rd order (3ksps), 'Data transmission filter'. It's Raised Cosine with a 100% roll off factor (alpha), derived using a Matched-Z transform). Flat 2ms delay. Roll off about 17dB/octave above 80Hz. Very clean step response. john
Reply to
John Jardine.

[...]

Just a late in the day thought:

First about your signal:

Lets say that your "signal" is some sort of pulse. By shifting the phase of the components of this pulse, we can make it look more or less like a band limited impulse.

** ** ** * * ** ** *** ********

It seems to me, that this shape is the sort of thing you want to have for a signal. You can compare for above some level to know that an event has happened.

Now about the noise:

Think about the noise as a whole bunch of pulses (both plus and minus going) that have been filtered in some funny way to make your noise spectrum.

I think, if your filter flattens the noise spectrum so that the noise at all frequencies is nearly equal, your signal's pulse will be the furthest above the noise and will be detected the most quickly.

This argues not just for a cut off frequency but also for the right slope in the early part of the cut off.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

first of all, *thank* *you* to everyone for the very interesting replies, at last i've a bit of time to try your suggestions (and ask for a filter book to my boss ;-) )

before the book is bought i would like to try at least a part of your suggestions:

- equiripple (i'm completely lost, i'll probably have to way the book...)

- (i hope) raised cosine (lost as well, wait(book)...)

- gaussian

the latter seems interesting and easier to try without the book, but i have to understand and tweak it a bit; i'm using matlab to try it

matlab has this "fspecial" constructor which requires:

H = FSPECIAL('gaussian',N,SIGMA) returns a rotationally symmetric Gaussian lowpass filter with standard deviation SIGMA (in pixels). N is a 1-by-2 vector specifying the number of rows and columns in H. (N can also be a scalar, in which case H is N-by-N.) If you do not specify the parameters, FSPECIAL uses the default values of [3 3] for N and 0.5 for SIGMA.

so it's suited for example for use with (finite) images...

well... i have a continuous monodimensional stream of samples.... how do i should interpret the "N dimensions" vector? if i fix one dimension to 1, is the other is related to the filter order?

the sigma.... i'll google about it ;-) (i suppose it relates to how "shaped" is the bell curve... i don't know about gaussian curves but iirc they relate to distributions, and sigma could be the... deviation? i'll see)

moreover i found this

formatting link

"A recursive implementation of the Gaussian filter. This implementation yields an infinite impulse response filter that has 6 MADDs per dimension independent of the value of sigma in the Gaussian kernel"

still it requires a finite number of points as input....

i understand that my "finite window vs infinite stream of samples" doubt is quite trivial but... can you give me a little hint?

thank you again

Reply to
gst

:blush:.... :buryheadundersand:...

Reply to
gst

That Gaussian function is an image filter. You want the "communications" filter:

formatting link

Reply to
Fred Bloggs

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.