DSPRelated.com
Forums

Analyzing Cross Spectrum for Pitch.

Started by MatthewA May 17, 2016
Eric Jacobsen wrote:
> On Fri, 20 May 2016 00:00:57 +0300, Evgeny Filatov > <e.v.filatov@ieee.org> wrote: > >> On 19.05.2016 23:38, dbd wrote: >>> On Thursday, May 19, 2016 at 5:57:32 AM UTC-7, Evgeny Filatov wrote: >>>> On 18.05.2016 15:24, Cedron wrote: >>>>> [...snip...] >>>>>> Also, one can find the true frequency value by fitting three FFT bins >>>>>> near the maximum value with a parabola. That option is discussed e.g. in >>> >>>>>> "Understanding DSP" by Lyons. >>> >>>>>> Gene >>> >>>>> Sorry, this is another estimator, not a "true" value. >>> >>>> I stand corrected. >>>> Gene >>> >>> Actually, any calculation performed on real world sampled data is an estimator except to the intellectually dishonest, or impaired, who expect that -you- live in -their- imaginary world that they don't reveal (or perhaps understand) the details of. Estimators are often chosen in the real world because they are more accurate than proposed "true" value formulas that make unadmitted assumptions that are not met. >>> >>> Dale B. Dalrymple >>> >> >> Indeed, there's no way to estimate true frequency of a noisy sinusoid. >> What you care about is whether your estimator attains the CRB (among >> other questions). >> >> I agreed with him because Cedron's claim may be correct (I don't know >> anything about his estimator) in the case of infinite SNR, which >> corresponds to CRB = 0. Which is, of course, utterly unrealistic, unless >> you are dealing with a mathematical model of something. > > And if it's a numeric model with quantized samples there will be, at a > minimum, quantization noise. > > Plus the whole finite-time observation thing. > > So, yeah, they're all estimators. > >
For something like guitar tuner, it's got "better" accuracy than the device being measured ( a guitar string ). +/- one cent is typical for a string. -- Les Cargill
[...snip...]

>>> >>> Actually, any calculation performed on real world sampled data is an >estimator except to the intellectually dishonest, or impaired, who
expect
>that -you- live in -their- imaginary world that they don't reveal (or >perhaps understand) the details of. Estimators are often chosen in the
real
>world because they are more accurate than proposed "true" value formulas >that make unadmitted assumptions that are not met. >>> >>> Dale B. Dalrymple >>>
There is no intellectually dishonesty here, at least on my part. I assumed by "true", the poster meant mathematically exact in a theoretical sense. The assumptions behind the formula are pretty simple and they are rigid. It applies to a signal that is a single pure sinusoidal of constant amplitude throughout the measuring frame. On the other hand, even at the theoretical level, an "estimator" will have some sort of discarded higher order terms and thus become somewhat inaccurate even under the most ideal conditions. Whether that is significant needs to be situationally determined. In my testing, none of the estimators have performed consistently better than my formula. The less noise there is, the better mine does in comparison. This is clearly shown in Julien's paper as well. As pointed out by Martin Vicanek, my equation is actually overdetermined so it is not unique. He has derived a two-bin formula which can be found here: http://www.vicanek.de/articles/FreqFromTwoBins.pdf I have a different two bin formula which I have not published. Mainly because his seems to outperform mine in many cases. However, both are "true" meaning in the absence of noise or other tones both give an answer that is good to the limit of the precision used.
>> >>Indeed, there's no way to estimate true frequency of a noisy sinusoid. >>What you care about is whether your estimator attains the CRB (among >>other questions). >> >>I agreed with him because Cedron's claim may be correct (I don't know >>anything about his estimator) in the case of infinite SNR, which >>corresponds to CRB = 0. Which is, of course, utterly unrealistic, unless
>>you are dealing with a mathematical model of something.
The CRB is a bound, not a limit. If you are interested in verifying my claim for yourself, the math is not that difficult and is fully presented in my blog articles.
> >And if it's a numeric model with quantized samples there will be, at a >minimum, quantization noise. >
Quite true.
>Plus the whole finite-time observation thing. >
Which comes from the continuous case with the integration definition and is totally irrelevant in the discrete case. It is quite possible to get an exact answer on a finite interval if the tone is a pure sinusoidal of lower frequency than the Nyquist frequency. Indeed, it is possible in the mathematically pure case to get an exact answer on an interval that is much shorter than the actual wavelength.
>So, yeah, they're all estimators.
In real world cases, this is correct. The difference is whether you have an understanding of the math you are working with. Ced --------------------------------------- Posted through http://www.DSPRelated.com
On 20.05.2016 23:20, Cedron wrote:
(snip)
> The CRB is a bound, not a limit.
Do you use the word "limit" in a mathematical sense?
> If you are interested in verifying my claim for yourself, the math is not > that difficult and is fully presented in my blog articles. >
Thanks, not now. Gene
On Friday, May 20, 2016 at 1:20:16 PM UTC-7, Cedron wrote:
> [...snip...] > > There is no intellectually dishonesty here, at least on my part. I > assumed by "true", the poster meant mathematically exact in a theoretical > sense.
There is no 'mathematically exact' in any non-trivial dsp. Non-trivial includes operations including any of: sampling, quantization, representation in fixed or floating point, external noise and the presence of multiple components as a start. The OP indicates analysis of sample data with results that indicate one or more of the non-trivialities are likely. The OP sought a solution that indicated the first harmonic instead of the second harmonic of a component. He didn't complain about the error due to rounding to the nearest bin. That is not a 'mathematically exact' situation. This is comp.dsp. It has been explained to you before that the context here is not 'mathematically exact' unless explicitly stated.
> The assumptions behind the formula are pretty simple and they are > rigid. It applies to a signal that is a single pure sinusoidal of > constant amplitude throughout the measuring frame. >
But you did not post these limitations on your claim of 'true' until challenged. That's simply dishonest and your usual mode of operation here. ...
> > >So, yeah, they're all estimators. > > In real world cases, this is correct. The difference is whether you have > an understanding of the math you are working with. >
A better understanding comes from posters who begin with an honest presentation of the characteristics of the methods they present. Dale B. Dalrymple
>On Friday, May 20, 2016 at 1:20:16 PM UTC-7, Cedron wrote: >> [...snip...] >> >> There is no intellectually dishonesty here, at least on my part. I >> assumed by "true", the poster meant mathematically exact in a
theoretical
>> sense. > >There is no 'mathematically exact' in any non-trivial dsp. Non-trivial >includes operations including any of: sampling, quantization,
representation
>in fixed or floating point, external noise and the presence of multiple >components as a start. The OP indicates analysis of sample data with
results
>that indicate one or more of the non-trivialities are likely. The OP
sought a
>solution that indicated the first harmonic instead of the second
harmonic
>of a component. He didn't complain about the error due to rounding to
the
>nearest bin. That is not a 'mathematically exact' situation. This is >comp.dsp. It has been explained to you before that the context here is
not
>'mathematically exact' unless explicitly stated. >
To some people, understanding the theoretical foundation of practical techniques is important. To others it is not. You seem to be in the latter category, but I don't think you should presume to speak for everyone. I was not responding to the OP, I was responding to the assertion that a parabolic equation was a "true" formula. It is not, it is an approximation.
>> The assumptions behind the formula are pretty simple and they are >> rigid. It applies to a signal that is a single pure sinusoidal of >> constant amplitude throughout the measuring frame. >> > >But you did not post these limitations on your claim of 'true' until >challenged. That's simply dishonest and your usual mode of operation
here. Not explicitly, but I did say "Whether the precision of an exact formula is worth the extra computations compared to a good estimator depends on the cost of computation, the accuracy of your data, and the level of noise in the signal." I think anybody understanding the general use of mathematics within engineering should understand that that means about the same thing. I also referenced a paper which evaluates the formula in the presence of noise. I would think any reasonable reader would also understand from that, and an understanding of math in engineering, that the formula won't be exact with noise present.
> >... >> >> >So, yeah, they're all estimators. >> >> In real world cases, this is correct. The difference is whether you
have
>> an understanding of the math you are working with. >> > >A better understanding comes from posters who begin with an honest >presentation of the characteristics of the methods they present. > >Dale B. Dalrymple
The characteristics of my method are fully explained in my referenced blog article. I think your usual mode of operation here, in particular with regards to me, is to be nitpicky and argumentative. I would go as far as to call you a bully. Others may see it differently, but to call me dishonest is just disingenuous. Ced --------------------------------------- Posted through http://www.DSPRelated.com
On Fri, 20 May 2016 20:11:38 -0500, "Cedron" <103185@DSPRelated>
wrote:

>>On Friday, May 20, 2016 at 1:20:16 PM UTC-7, Cedron wrote: >>> [...snip...] >>> >>> There is no intellectually dishonesty here, at least on my part. I >>> assumed by "true", the poster meant mathematically exact in a >theoretical >>> sense. >> >>There is no 'mathematically exact' in any non-trivial dsp. Non-trivial >>includes operations including any of: sampling, quantization, >representation >>in fixed or floating point, external noise and the presence of multiple >>components as a start. The OP indicates analysis of sample data with >results >>that indicate one or more of the non-trivialities are likely. The OP >sought a >>solution that indicated the first harmonic instead of the second >harmonic >>of a component. He didn't complain about the error due to rounding to >the >>nearest bin. That is not a 'mathematically exact' situation. This is >>comp.dsp. It has been explained to you before that the context here is >not >>'mathematically exact' unless explicitly stated. >> > >To some people, understanding the theoretical foundation of practical >techniques is important. To others it is not. You seem to be in the >latter category, but I don't think you should presume to speak for >everyone. > >I was not responding to the OP, I was responding to the assertion that a >parabolic equation was a "true" formula. It is not, it is an >approximation. > >>> The assumptions behind the formula are pretty simple and they are >>> rigid. It applies to a signal that is a single pure sinusoidal of >>> constant amplitude throughout the measuring frame. >>> >> >>But you did not post these limitations on your claim of 'true' until >>challenged. That's simply dishonest and your usual mode of operation >here. > >Not explicitly, but I did say "Whether the precision of an exact formula >is worth the extra computations >compared to a good estimator depends on the cost of computation, the >accuracy of your data, and the level of noise in the signal." I think >anybody understanding the general use of mathematics within engineering >should understand that that means about the same thing. > >I also referenced a paper which evaluates the formula in the presence of >noise. I would think any reasonable reader would also understand from >that, and an understanding of math in engineering, that the formula won't >be exact with noise present. > >> >>... >>> >>> >So, yeah, they're all estimators. >>> >>> In real world cases, this is correct. The difference is whether you >have >>> an understanding of the math you are working with. >>> >> >>A better understanding comes from posters who begin with an honest >>presentation of the characteristics of the methods they present. >> >>Dale B. Dalrymple > >The characteristics of my method are fully explained in my referenced blog >article. I think your usual mode of operation here, in particular with >regards to me, is to be nitpicky and argumentative. I would go as far as >to call you a bully. Others may see it differently, but to call me >dishonest is just disingenuous. > >Ced
I think one thing that is very telling is that the majority of people here post under their real names. You don't. That actually says quite a bit.
> >I think one thing that is very telling is that the majority of people >here post under their real names. You don't. > >That actually says quite a bit.
If you can't attack the message, attack the messenger. This is known as an "ad hominem" fallacy, generally considered to be in poor form which says a bit about you, no? I have my reasons, and they are none of your business. I think your intended aspersions are baseless. I am not dishonest about it either, if you check my blogger profile you will see it starts with "Cedron Dawg is the pen name..." If you want to fault what I have said you can point out that I never backed up my claim that a parabolic fit was an approximation, not a true equation. My response would be, especially to a theory adverse crowd, that a numerical example should be sufficient and you can do that yourself. Getting back to the OP's original question. As far as I know, there is no true equation using a DFT for the situation he describes. However, any signal composed of pure tones, whether harmonic or not, can be decomposed to any desired degree of precision (within noise and numerical representation constraints) using an iterative method. If a signal is composed of only harmonic tones, as the OP's seems to be, then the signal will be periodic. For signals of this type, the autocorrelation and angrydude's methods will work. A less computationally intense approach would be to analyse the location of zero crossings. The autocorrelation and zero crossing techniques will get you an answer precise to the level of the number of samples. The precision can be improved by doing a parabolic fit at the autocorrelation peak for the former and linear best fits at the zero crossings for the latter. angrydude can chime in about his technique if he wishes. To put things in perspective, Les Cargill pointed out that one percent was adequate for a guitar string. An 'A' tone at 440Hz in a CD quality 44,100Hz recording is roughly 100 samples per wavelength. A one sample error on a one wavelength samping will then be about one percent. In comparison, every semitone on the standard chromatic music scale is about a 6% increase in frequency. ( 2^(1/12) = 1.059463094 ) I've met musicians who can tune their instruments by ear that can easily discern less than a 1% change in pitch. The percentage frequency change between bins in a DFT depend on the bin number and can be simply calculated using the ratio of the bin numbers. Ced --------------------------------------- Posted through http://www.DSPRelated.com
On 21.05.2016 6:09, Eric Jacobsen wrote:

(snip)

> I think one thing that is very telling is that the majority of people > here post under their real names.
And often not just names, but short forms of real names; like it helps to have an informal conversation? Gene
On Sat, 21 May 2016 08:03:20 -0500, Cedron wrote:


[snip]

> To put things in perspective, Les Cargill pointed out that one percent > was adequate for a guitar string. An 'A' tone at 440Hz in a CD quality > 44,100Hz recording is roughly 100 samples per wavelength. A one sample > error on a one wavelength samping will then be about one percent.
You're misquoting Les Cargill there. He said "1 cent" rather than "1 percent". 1 cent is 1 percent of 1 semitone. That's about 578ppm, and is not really perceptible to humans (unless it's in a chord, etc.). Regards, Allan
On Friday, May 20, 2016 at 6:11:40 PM UTC-7, Cedron wrote:
> [...snip...]
> > The characteristics of my method are fully explained in my referenced blog > article. I think your usual mode of operation here, in particular with > regards to me, is to be nitpicky and argumentative. I would go as far as > to call you a bully. Others may see it differently, but to call me > dishonest is just disingenuous. > > Ced
We have discussed before, in detail, why statements that might be understandable in the context of a comp.soft-sys.symbolic-manipulation would be considered misleading in the context of comp.dsp. That's treating you as an adult. You have been told that further misleading behavior would bring further discussion. Now you have repeated the behavior you know is considered misleading, apparently to market your blog, and here we are in the promised discussion. Your behavior hasn't gotten you bullied. It's gotten you recognized as behaving as a troll, whatever your reasons may be. Dale B. Dalrymple