The author of the C code was obviously pleased with his efforts and wanted to show it off, but this is not really the place. And the example is far too long for
| This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| It is requested that one or more mathematical diagrams be included in this article to improve its quality. Specific illustrations, plots, or diagrams can be requested at the Graphics Lab. For more information, refer to discussion on this page and/or the listing at Wikipedia:Requested images. |
The author of the C code was obviously pleased with his efforts and wanted to show it off, but this is not really the place. And the example is far too long for the purpose of demonstrating the algorithm. If used at all, it should demonstrate just the algorithm, not the application, and this is already more appropriately done in the pseudo-code. Not all readers will be C programmers, it should be more generally applicable. The bulk of the topic is a discussion of DTMF which is hardly the point nor the only application. Only a small part of the code is in fact related to the Goertzel algorithm. I'd remove it except that it might look like vandalism. This is not the place to publish school your projects ;) —Preceding unsigned comment added by 217.40.148.115 (talk) 12:19, 26 March 2009 (UTC)
Did the C code work? Because I tried implementing the pseudo-code in C and it does not appear to work. The returned values vary dramatically depending on the value of N samples I give the algorithm. Perhaps there should be some explanation on how to implement it properly? --24.91.253.46 (talk) 06:54, 25 April 2012 (UTC)
If you enter the word goertzel in Google, this article is the second hit. I started this article and posted the working C code. I had spent years perfecting this code and it was part of a telecom switch. It actually worked and there is the remote chance that if you have used a telephone, you may have exercised this code as you pushed the buttons on your phone. I posted the code hoping to save some fragments of knowledge from a dying industry and in hopes that others smarter than me would make comments on the code and show how such a simple code segment could do such magical work as to extract digits out of signal samples.
Well the code is now gone and is replaced by a mathematical discourse that is quite clear to the small fraction of the population who has survived several years of advanced mathematics and who probably already has several textbooks lying around covered with dust and which contain the same information as presented on this page in its current form.
I also have a stack of 10 or 20 books on signal processing purchased at various times at thrift stores for perhaps a 50 cents or a dollar a book. Which basically tells you the value of mathematical writings of this sort.
To the above poster: If perhaps you would like to make the world a better place, instead of having fun taunting those who have less education than yourself, you might consider sharing some of your knowledge in a form that matters more than those thrift store books. —Preceding unsigned comment added by 70.102.57.178 (talk) 21:49, 28 October 2010 (UTC)
I am not the poster you are responding to, but I would like to respond to your comment. I sympathize with your conclusion, having struggled through the math in so many Wikipedia articles on DSP. How many times I could have screamed - just give me the code! In the end, however, it appears that the policy of Wikipedia is to just present the high level math. Bit by bit, I am learning to understand that math, though it has taken me years, without a proper academic founding in the subject.
As to the current article, I would like to commend the author(s) for doing an excellent job. After reading many times over several days, I finally understand it in its entirety. The author(s) have provided me with a wealth of insights on the topic.
In conclusion, I would like to ask Wikipedia to consider that pseudocode should be attached to every article on DSP such as this, and the article not be considered complete without it. TropicalCoder (talk) 15:49, 7 July 2015 (UTC)
I see sample code in C but nothing in English that describes the algorithm. --Damian Yerrick (☎) 19:30, 25 March 2006 (UTC)
I have used the C code and have found that the number of samples used can have a signeficant effect on the accuracy of the filter. I would like to know more about the practical selection of the value for GOERTZEL_N. --R Parker ANU 00:32, 14 February 2007 (UTC)
Here are some things that should be fixed, but which I don't have time to fix now:
—Steven G. Johnson 05:45, 3 January 2007 (UTC)
I'm a bit skeptical about the code line of
power = sprev2*sprev2 + sprev*sprev - coeff*sprev*sprev2 ;
That actually seems like the square of the real component and does not include the imaginary component. Perhaps it should be something more like
power = sprev2*sprev2 + sprev*sprev - coeff*sprev*sprev2 + wi*sprev2*sprev2 ;
It also does not seem to correctly scale the result by a factor of ( 2 / Nterms). As a stawman, consider replacing that line with
i = sprev - sprev2 * coef * 2 / Nterms q = sprev2 * wi * 2 / Nterms power = i*i + q*q
I have not checked that is correct but it would be nice if someone else looked at see if they agree
Cullenfluffyjennings (talk) 23:11, 16 August 2013 (UTC)
This:
power = sprev2*sprev2 + sprev*sprev - coeff*sprev*sprev2 ;
Is indeed correct. If you simplify this:
sqrt((cr * sprev - sprev2)^2 + (ci*sprev)^2)
you get the above answer, obviously with coeff equalling cr*2
The real question is why the imaginary component is:
ci*sprev
Instead of
ci*sprev - sprev2
At the moment, I'm getting nothing but strange results no matter how I tweak the algorithm. Oh well.
09:26, 9 August 2014 (UTC)124.190.22.24 (talk) 09:26, 9 August 2014 (UTC)
Is there a good external link that could be added (or academic reference) that explains how the algorithm is used in practice in reverse, say to generate DTMF tones? I have some DTMF generation code (the DtmfGenerator code by Plyashkevich Viatcheslav that's floating around in C and Java - don't know where it originally came from) that I think uses Goertzel in reverse for generating as well as recognizing the DTMF signal. But it doesn't explicitly say that, and the math is way over my head to try to figure it out from the code alone - it uses a transform function that goes by the name MPY48SR as part of the algorithm, and looks like it iteratively modifies and shifts a matrix of 6 values. That's all I can see from the code, anyway.. Anyway, anybody know a reference for theory and practice of reversing the algorithm for generation? — Preceding unsigned comment added by Jimw338 (talk • contribs) 20:55, 1 April 2012 (UTC)
It seems silly to me to employ a Goertzel "in reverse" - whatever that means, when all that is required to generate a sine wave is magnitude * sin(current_phase) for each sample. It doesn't get any simpler than that. I suppose on limited embedded applications one would prefer not to require computing the sine, or even not having to use floating point. If the frequency is an integral of the sampling rate, one could simply save the values for one period in ROM and spit them out - as many periods and a fraction thereof as required at run time. Or save half a period in ROM and change the sign for the second half of the period. Or save a quarter of a period and reverse that as required and add the sign to reconstitute the whole period. TropicalCoder (talk) 15:38, 7 July 2015 (UTC)
After referring to this article to see how well it covered the most important cases of applying the algorithm to real-valued data — and being disappointed — I continued studying why the article presentation seemed uneven. Here is my ill-considered list of problems, inaccuracies, and presentation glitches. My notations, if you wish to track details, are "Paragraph within section" counting parts separated by equation lines as if they were separate paragraphs, and "Sentence" within each paragraph.
Intro
Explanation
Implementation
Complexity
Overall I am proposing a rewrite that will cover all of the issues above while discarding very little from what is currently in the article. Not ready to post, I need some numerical validation first. So past contributors, do not panic. Your contributions should still be there, but maybe located in a different place, maybe with some different dressing. Mostly, a much greater emphasis on more specific and orderly presentation with respect to practical calculations of DFT terms. I have some concerns about overall bulk. ParaTechNoid (talk) 00:45, 29 October 2012 (UTC)
I have posted the rewrite, which I think offers an improved balance between theoretical accuracy and practical usefulness. But then again, nothing is perfect. The things that some might find controversial:
ParaTechNoid (talk) 21:05, 18 November 2012 (UTC)
All the equations in this page use 2*pi*omega as the argument of trigonometric functions. This is confusing at best. They should either be written as omega (which I recommend) or 2*pi*f. Larry Doolittle (talk) 18:14, 17 October 2013 (UTC)
I do not have a signal processing background but whoever sprayed the text with Citation needed flags was obviously not qualified to do so. There is a childish level of mathematical knowledge assumed that does not need citation. The most egregious example is the citation request for equation 6 which is simply derivable from equation 5 which has no similar request. Equation 2 is in context obviously required to be this form for the algorithm to make sense and the initialisation of the state vector to zero is in some sense arbritary but if the algorithm is to be used for a DFT is obviously required to have an unbiased result. Anyone to whom this is not obvious should not be commenting. It would not make sense to require a citation for a statement concerning real numbers like 1 + 1 = 2. 109.239.88.226 (talk) 11:21, 7 March 2014 (UTC)AJ
Seconding the above. This "citation needed" business is plain silly and induces facepalm. There is a T101 in your kitchen (talk) 17:41, 24 November 2014 (UTC)
Thirding the above. My exact same thought (including the example!). Can we remove those "citation needed" flags now? — Preceding unsigned comment added by 213.123.251.51 (talk) 09:45, 10 February 2015 (UTC)
I have added the section "Comparing the Goertzel with the DFT". This also demonstrates obtaining the phase and magnitudes as we would expect to receive them from a DFT. Though an embedded implementation of the Goertzel will likely have no interest in this kind of information, one certainly needs it to verify their code. My C++ implementation of the pseudo code listing that I linked to in the External Links section has been rigorously tested with dozens of frequencies, each with 16 different initial phase offsets. Worst case errors recorded were in the range of 250 PPM for phase and 30 PPM for magnitude in the case of the Goertzel, whereas it was only 5 PPM for phase and 8 PPM for magnitude for the DFT. Where the number of samples in a period was a whole number, the errors were pretty close to 0 for either algorithm. TropicalCoder (talk) 00:34, 11 July 2015 (UTC)
The article, as written, fails to address the most important point: connecting the algorithm back to its intended purpose. The article never relates the results of the transform y back to the DFT terms that are being sought. Nor does it explain how the final summation is to be used. As a result, a reader unfamiliar with the topic is unable to get almost any useful information from the article as written. Can someone familiar with the topic add this important information? — Preceding unsigned comment added by Wmagro (talk • contribs) 13:09, 31 October 2015 (UTC)
I see it was tagged a possible conflict of interest. How did you come to that conclusion? Lakeweb.net is a personal website and all the content is open source. Please respond. http://lakeweb.net/MSP430/PrivateLine/Goertzel_Algorithm.html Thanks, Dan (talk) 19:42, 12 July 2016 (UTC)
I am not offering something about myself, I am not advertising. The two other links do not offer any complete working example. In the VS solution there are three working and very usable projects. You should take a look at it.Dan (talk) 23:16, 12 July 2016 (UTC)
Ok, If it is about how it 'looks' rather than content... But as far as I know it is the only source of a complete working set of code to test the algorithm, develop the target code, and generate a target header of coefficients. I won't bother you with this anymore. Dan (talk) 16:23, 13 July 2016 (UTC)
The section "DFT computations" reuses for the "bin number" of the discretized frequency, swapping in without warning for the resulting sequence's sequence index in equation (9). This is tremendously confusing if you're following along with the derivation, as it leads you to believe that the frequency bin number should be indexed along with the sum, as seen in this Math.SE question.
I propose using or some other letter instead of . An edit that does this looks like the below:
— Preceding unsigned comment added by 107.3.128.7 (talk • contribs) 05:06, 13 October 2016 (UTC)
For the important case of computing a DFT term, the following special restrictions are applied.
| 7 |
| 8 |
Making these substitutions into equation (6) and observing that the term , equation (6) then takes the following form:
| 9 |
— Preceding unsigned comment added by 107.3.128.7 (talk • contribs) 05:06, 13 October 2016 (UTC)
This article is an example of everything which is wrong with Wikipedia.
Instead of giving a simple explanation and a block diagram, it launches immediately into mind-boggling maths, which will only serve to repel most readers.
Presumably this happens is because the authors want to show how clever they are, but in actual fact have no real grasp on the subject at all.
The Goertzel algorithm is an evolution of the age-old Super-Regenerative radio receiver, as invented by Armstrong back in 1913.
see https://en.wikipedia.org/wiki/Regenerative_circuit
It uses an Oscillator which is keyed on for a short time by a Quench signal. When the Oscillator first starts, the Q of the tuned circuit causes the amplitude to build slowly.
However, if there is a signal present (at the right frequency) the output builds more quickly. If the Oscillator is stopped before it saturates, the amplitude remaining is proportional to the incoming frequency.
In the Goertzel algorithm, exactly the same thing happens, except it uses a simple IIR oscillator.
— Preceding unsigned comment added by Gutta Percha (talk • contribs) 07:45, 10 March 2017 (UTC)
Just an observation from a basic user of Wikipedia. The PDF converter doesn't pick up (many of) the equations in the article, rendering blank spaces in the PDF instead of the equations.
Maybe the format of the equations could be changed to something the PDF converter recognizes?
Best regards to the community. — Preceding unsigned comment added by 130.65.41.187 (talk) 00:04, 11 April 2017 (UTC)
In the Application section value ci is set however it is not used in the pseudcode offered. The ci value is used to compute the imaginary part which is not used in the example shown. Either the full algorithm should be shown else the ci line should be removed. SoftwareThing (talk) 22:22, 7 September 2018 (UTC)
what is the j in the exponent term?
it says bla bla to the power of -jw0. i understand the w0 part, but what is j? — Preceding unsigned comment added by 101.98.178.115 (talk) 10:32, 24 July 2019 (UTC)
Rick Lyons (author of "Understanding DSP") wrote a blog post to specifically to address a perceived mistake in this very wikipedia article, regarding the stability of goertzel filters: https://www.dsprelated.com/showarticle/796.php — Preceding unsigned comment added by 46.151.207.2 (talk) 12:55, 25 July 2023 (UTC)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.