Im using the Goertzel algorithm to look for the presence of two particular frequency sets in a given signal. One is a particular type of interference, and the other is useful data of a known wavelength. The idea being that if the signal comprises mainly interference then we skip some processing steps, but if there is interference AND a signal we do some other processing. Its a simple gate check done in real-time which is why we have moved away from more complicated FFT etc. The problem i have at the moment is how to evaluate the magnitude output from two separate Goertzel processing outputs. The block size for each is different due to the nature of the waveform being searched so i cant do a straight numerical comparison. Can i treat the Goertzel magnitude calculation like a band-step, and compare the area under the curve for each, i.e. multiple by a function of N? I am struggling for resources concerning the interpretation of the Goertzel algorithm output. Any feedback would be incredibly helpful.

# Goertzel Implementation Magnitude Check

Started by ●October 26, 2011

Reply by ●October 26, 20112011-10-26

djc-mrxtech wrote:> Im using the Goertzel algorithm to look for the presence of two particular > frequency sets in a given signal. One is a particular type of interference, > and the other is useful data of a known wavelength. > > The idea being that if the signal comprises mainly interference then we > skip some processing steps, but if there is interference AND a signal we do > some other processing. Its a simple gate check done in real-time which is > why we have moved away from more complicated FFT etc. > > The problem i have at the moment is how to evaluate the magnitude output > from two separate Goertzel processing outputs. The block size for each is > different due to the nature of the waveform being searched so i cant do a > straight numerical comparison. > > Can i treat the Goertzel magnitude calculation like a band-step, and > compare the area under the curve for each, i.e. multiple by a function of > N? > > I am struggling for resources concerning the interpretation of the Goertzel > algorithm output. Any feedback would be incredibly helpful. > >

Reply by ●October 26, 20112011-10-26

On 10/26/2011 10:51 AM, djc-mrxtech wrote:> Im using the Goertzel algorithm to look for the presence of two particular > frequency sets in a given signal. One is a particular type of interference, > and the other is useful data of a known wavelength.Wavelength? You need the propagation speed to connect wavelength and frequency. We generally specify frequency because it's independent of the medium. Why not use a frequency-discriminating filter if the interference and the useful signal reside in different bands?> The idea being that if the signal comprises mainly interference then we > skip some processing steps, but if there is interference AND a signal we do > some other processing. Its a simple gate check done in real-time which is > why we have moved away from more complicated FFT etc. > > The problem i have at the moment is how to evaluate the magnitude output > from two separate Goertzel processing outputs. The block size for each is > different due to the nature of the waveform being searched so i cant do a > straight numerical comparison. > > Can i treat the Goertzel magnitude calculation like a band-step, and > compare the area under the curve for each, i.e. multiple by a function of > N?What is a band step?> I am struggling for resources concerning the interpretation of the Goertzel > algorithm output. Any feedback would be incredibly helpful.The Goertzel algorithm effectively implements a single bin of a DFT. Jerry -- Engineering is the art of making what you want from things you can get.

Reply by ●October 26, 20112011-10-26

Jerry Avins <jya@ieee.org> wrote:> On 10/26/2011 10:51 AM, djc-mrxtech wrote: >> Im using the Goertzel algorithm to look for the presence of two particular >> frequency sets in a given signal. One is a particular type of interference, >> and the other is useful data of a known wavelength.> Wavelength? You need the propagation speed to connect wavelength and > frequency. We generally specify frequency because it's independent of > the medium.Except in spectroscopy. In the beginning of optical spectroscopy the speed of light wasn't known as accurately as wavelengths could be measured (with diffraction gratings). As I understand it, for that reason they avoided frequency. To get a quantity that scales properly they instead went to wavenumber (some constant divided by wavelength). Presumably one can do spectroscopy in vacuum, or correct for the index of refraction of air. -- glen

Reply by ●October 26, 20112011-10-26

On Wed, 26 Oct 2011 12:47:30 -0400, Jerry Avins wrote:> On 10/26/2011 10:51 AM, djc-mrxtech wrote: >> Im using the Goertzel algorithm to look for the presence of two >> particular frequency sets in a given signal. One is a particular type >> of interference, and the other is useful data of a known wavelength. > > Wavelength? You need the propagation speed to connect wavelength and > frequency. We generally specify frequency because it's independent of > the medium. > > Why not use a frequency-discriminating filter if the interference and > the useful signal reside in different bands? > >> The idea being that if the signal comprises mainly interference then we >> skip some processing steps, but if there is interference AND a signal >> we do some other processing. Its a simple gate check done in real-time >> which is why we have moved away from more complicated FFT etc. >> >> The problem i have at the moment is how to evaluate the magnitude >> output from two separate Goertzel processing outputs. The block size >> for each is different due to the nature of the waveform being searched >> so i cant do a straight numerical comparison. >> >> Can i treat the Goertzel magnitude calculation like a band-step, and >> compare the area under the curve for each, i.e. multiple by a function >> of N? > > What is a band step? > >> I am struggling for resources concerning the interpretation of the >> Goertzel algorithm output. Any feedback would be incredibly helpful. > > The Goertzel algorithm effectively implements a single bin of a DFT.The Goertzel algorithm effectively implements a single bin of a DFT, in an obscure and hard to analyze way. One _could_ just implement a one-bin DFT, for significantly fewer resources than a whole DFT (even an FFT), for not too terribly much more resources than for a Goertzel, and with code and theory that's much more clear. -- www.wescottdesign.com

Reply by ●October 26, 20112011-10-26

On 10/26/2011 3:49 PM, glen herrmannsfeldt wrote:> Jerry Avins<jya@ieee.org> wrote: >> On 10/26/2011 10:51 AM, djc-mrxtech wrote: >>> Im using the Goertzel algorithm to look for the presence of two particular >>> frequency sets in a given signal. One is a particular type of interference, >>> and the other is useful data of a known wavelength. > >> Wavelength? You need the propagation speed to connect wavelength and >> frequency. We generally specify frequency because it's independent of >> the medium. > > Except in spectroscopy.Except in optics generally. The OP's reference to Goertzel's algorithm made it clear that optics is not in the realm of interest.> In the beginning of optical spectroscopy > the speed of light wasn't known as accurately as wavelengths > could be measured (with diffraction gratings). As I understand > it, for that reason they avoided frequency. To get a quantity > that scales properly they instead went to wavenumber (some constant > divided by wavelength). Presumably one can do spectroscopy in > vacuum, or correct for the index of refraction of air.Index of refraction is given as a function of wavelength in air. It makes sense, but I find it odd anyway. Jerry -- Engineering is the art of making what you want from things you can get.

Reply by ●October 26, 20112011-10-26

On Wed, 26 Oct 2011 15:12:32 -0500, Tim Wescott <tim@seemywebsite.com> wrote:>On Wed, 26 Oct 2011 12:47:30 -0400, Jerry Avins wrote: > >> On 10/26/2011 10:51 AM, djc-mrxtech wrote: >>> Im using the Goertzel algorithm to look for the presence of two >>> particular frequency sets in a given signal. One is a particular type >>> of interference, and the other is useful data of a known wavelength. >> >> Wavelength? You need the propagation speed to connect wavelength and >> frequency. We generally specify frequency because it's independent of >> the medium. >> >> Why not use a frequency-discriminating filter if the interference and >> the useful signal reside in different bands? >> >>> The idea being that if the signal comprises mainly interference then we >>> skip some processing steps, but if there is interference AND a signal >>> we do some other processing. Its a simple gate check done in real-time >>> which is why we have moved away from more complicated FFT etc. >>> >>> The problem i have at the moment is how to evaluate the magnitude >>> output from two separate Goertzel processing outputs. The block size >>> for each is different due to the nature of the waveform being searched >>> so i cant do a straight numerical comparison. >>> >>> Can i treat the Goertzel magnitude calculation like a band-step, and >>> compare the area under the curve for each, i.e. multiple by a function >>> of N? >> >> What is a band step? >> >>> I am struggling for resources concerning the interpretation of the >>> Goertzel algorithm output. Any feedback would be incredibly helpful. >> >> The Goertzel algorithm effectively implements a single bin of a DFT. > >The Goertzel algorithm effectively implements a single bin of a DFT, in >an obscure and hard to analyze way. > >One _could_ just implement a one-bin DFT, for significantly fewer >resources than a whole DFT (even an FFT), for not too terribly much more >resources than for a Goertzel, and with code and theory that's much more >clear.One advantage of the Goertzel algorithm or the sliding-Window DFT is that they're free-running, i.e., it's not block-oriented like the DFT or FFT. This can help reduce latency, or at least make latency more predictable, when detecting the onset of tones, e.g., for something like DTMF. The sliding-window DFT gives the same output as the DFT of the past N samples, so it's not difficult to analyze its behavior or the behavior of an output bin. It is not necessary to compute every bin of the sliding-window DFT, so it can be used for specific frequencies just like the Goertzel algorithm, with the Goertzel algorithm being more appropriate for real-valued signals. Comparing the two might provide some insights on answering the questions posed by the OP. Eric Jacobsen Anchor Hill Communications www.anchorhill.com

Reply by ●October 28, 20112011-10-28

On Oct 26, 10:51�am, "djc-mrxtech" <djc@n_o_s_p_a_m.mrxtech.co.uk> wrote:> I am struggling for resources concerning the interpretation of the Goertzel > algorithm output. Any feedback would be incredibly helpful.Goertzel gives you the same answer as the DFT (but has stablility problems). So divide by N to normalize, then do the compare. BTW The single point DFT runs faster in every modern DSP I have used as compared to the Goertzel, mainly because modern DSP's are hardwired to be fed and perform sequential MAC's very quickly, which is what the DFT wants. ARM processors run it faster too. Also I can usually use lower precision math to perform the DFT, whereas the Goertzel I usually need double precision (depending on the length). The only advantage to the Goertzel nowadays is it uses only one coefficient, so you can on the fly change the frequency of interest.

Reply by ●November 1, 20112011-11-01

On Oct 26, 4:12=A0pm, Tim Wescott <t...@seemywebsite.com> wrote:> On Wed, 26 Oct 2011 12:47:30 -0400, Jerry Avins wrote: > > On 10/26/2011 10:51 AM, djc-mrxtech wrote: > >> Im using the Goertzel algorithm to look for the presence of two > >> particular frequency sets in a given signal. One is a particular type > >> of interference, and the other is useful data of a known wavelength. > > > Wavelength? You need the propagation speed to connect wavelength and > > frequency. We generally specify frequency because it's independent of > > the medium. > > > Why not use a frequency-discriminating filter if the interference and > > the useful signal reside in different bands? > > >> The idea being that if the signal comprises mainly interference then w=e> >> skip some processing steps, but if there is interference AND a signal > >> we do some other processing. Its a simple gate check done in real-time > >> which is why we have moved away from more complicated FFT etc. > > >> The problem i have at the moment is how to evaluate the magnitude > >> output from two separate Goertzel processing outputs. The block size > >> for each is different due to the nature of the waveform being searched > >> so i cant do a straight numerical comparison. > > >> Can i treat the Goertzel magnitude calculation like a band-step, and > >> compare the area under the curve for each, i.e. multiple by a function > >> of N? > > > What is a band step? > > >> I am struggling for resources concerning the interpretation of the > >> Goertzel algorithm output. Any feedback would be incredibly helpful. > > > The Goertzel algorithm effectively implements a single bin of a DFT. > > The Goertzel algorithm effectively implements a single bin of a DFT, in > an obscure and hard to analyze way. > > One _could_ just implement a one-bin DFT, for significantly fewer > resources than a whole DFT (even an FFT), for not too terribly much more > resources than for a Goertzel, and with code and theory that's much more > clear. >Goertzel showed just one among many ways to recursively calculate a single bin of the DFT. Plus his method lends itself nicely to calculate the discrete cosine transform and this approach is often used in jpeg encoders. A simple and straightforward path to the analysis can be had via matrices. Pretty much any 2nd order oscillator structure can be used in a Goertzel type of analysis. Some structures yield a very nice simplification and still exhibit nice numerical properties. Clay