# LabVIEW

cancel
Showing results for
Did you mean:

## Finding the group delay of a filter

Has anyone implemented a function to find the group delay (the time between the filter's initial response and its peak response)of the different digital filters in LabVIEW?

I need to track the arrival of a certain part of a signal. I know approx. when it is to arrive, however locating it gets complicated due to the variable delay caused by the necessary filtering (delay depends on the frequencies, filter order, type etc.) .

I see that MatLAB / MatWorks has a group delay function, but perhaps someone has made a G equivalent?

The digital filter design toolkit is said to have analysis tools that can give you the group delay...but I'm not sure if that could be used to find the delay in any case programmatically? Even if it can I'm a bit reluctant to buy the toolkit just for that functionality...

I though I had solved it when I found a description of how to calculate the delay of a Butterworth filter (at least) on: http://www.mathcad.com/Library/LibraryContent/MathML/group_b.htm

The results are in the right ballpark...but sometimes it fails by more than 5 microseconds and that's not good enough for my application (could be an incorrect implementation off course).

If I use correlation to find the delay I get extremely good results, however that will not be robust enough (there could be other strong features, e.g. due to reflections, that might mislead the correlation.).

An alternative might be to let the application generate a nice signal with the right frequencies internally, run it through the chosen filter setup and find the group delay by correlation on that signal...then apply it on the real signal. The most elegant thing would be to be able to do it mathematically though.
Message 1 of 2
(3,101 Views)

## Re: Finding the group delay of a filter

Group delay is defined as Tgd = - dB/dw where B is the phase shift in radians and w is the angular frequency in radians per second. Given that, it should not be too difficult to calculate. I recently implemented in LV 7.1 a group delay calculation from the frequency response for an external circuit analysis (SPICE). I had an array of amplitudes vs. frequency and calculated the group delay as a function of frequency from that. If this will help, let me know and I can post it.

Lynn
Message 2 of 2
(3,096 Views)