DSPRelated.com
Forums

FFT and Sine Waves Question

Started by Raeldor August 26, 2011
On 8/27/11 3:14 PM, dbd wrote:
> .On Aug 27, 7:45 am, robert bristow-johnson > <r...@audioimagination.com> wrote: >> On 8/27/11 1:59 AM, dbd wrote: >> >> >> >>> On Aug 26, 8:16 pm, robert bristow-johnson<r...@audioimagination.com> >>> wrote: >>>> ... >> >>>> of course that's a settled topic. i'm with Dijkstra, quoting: >> >>>> http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html >> >>>> "Real computer programmers count from 0. Anyone who insists on counting >>>> from 1 is either a douchebag or a MATLAB developer." >> >>> Robert >> > .> > You are becoming so advanced! You have progressed to your lying > .> > about quotations > .> > .> how would you know, Dale? did you read the Dijkstra reference from > .> beginning to end? > > I read the posted reference and even the handwritten version: > http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
good! then i accomplished my purpose (at least where you are, Dale).
> Are you quoting out of context and lying about it again?
"again"?
> The archive search function finds no mention of Matlab either. > > Why would I need to read the archive from beginning to end?
ostensibly to check whether Dijkstra actually said what was attributed to him (he didn't), but the real reason is to actually read through the whole thing to be fully exposed to the case that Dijkstra makes. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On 8/27/2011 2:14 PM, Fred Marshall wrote:

   ...

> Rather than being annoyed by the reality that both conventions and > perspectives do exist, I think it's a lot better to just deal with it.
Agreed, but it is annoying to be forced to use a convention that seems poorly adapted to the application. If a boy is a year old on his first birthday. how old is he on his birth day? What year did AD begin. When did the 21st century begin? Ugh! Jerry -- Engineering is the art of making what you want from things you can get.
On 8/27/2011 9:19 AM, Jerry Avins wrote:
> On 8/27/2011 12:09 PM, Richard Dobson wrote: > > ... > >> Similarly, the fundamental is the first harmonic, among possibly many >> (where "harmonic" may be understood as "mode of vibration"). OK, if you >> want, the "zeroth harmonic" is DC, but that will always be somewhat >> contrived in language. Presented with a basket of ten apples, we count >> the apples to give the answer ten (and, no doubt, counted from one to >> ten inclusive), not eleven to include the basket itself, which is >> content-agnostic, just as DC is harmonic-agnostic. Everyday speech is >> almost exclusively ordinal in character, while cardinal counting from >> zero remains the best programmatic use of the available range of a >> number, etc etc etc. So programmers will continue counting from zero, >> hoping the zeroth apple will be available to consume, while all other >> carbon-based lifeforms, including musicians fretting about harmonics, >> will continue happily counting from one. > > Calling DC the zeroth harmonic makes good mathematical sense. Symmetric > distortion produces only odd harmonics, normally including the first. > Asymmetric distortion produces also even harmonics, normally including > the zeroth, an offset. > > For me, it also makes esthetic sense. > > Jerry
Yes and note that after all the very logical discussion of which notation he likes the best [that is (a)], he goes on to say: "So let us let our ordinals start at zero: an element's ordinal (subscript) equals the number of elements preceding it in the sequence." That's all well and good but having the element's ordinal equal the number of elements *preceding it* in the sequence assumes always sequences that start at zero *AND* that one "likes" this odd convention. I usually think: 0 to 255 and not 0 and less than 256 I usually think: 0 to 255 as having 255+1 elements or x to y having (y-x)+1 elements. I don't usually think: 1 to 255, now let's see, the next ordinal would be 255+1 = 256 so THERE's the number of elements in 0 to 255. I don't usually think: 2 to 255, now let's see, the next ordinal would be 255+1 less 2 would be 254. Rather, as above, 255-2+1=254 ... which looks a lot like 255+1-2 :-) But, knowing where Dijkstra is coming from gives pause to consider the validity of his arguments nonetheless. If I'm not *thinking* about it but, rather, writing code then OK. Maybe (a) really is good coding notation but I've not pondered it.... Fred
On 28/08/2011 01:43, Jerry Avins wrote:
> On 8/27/2011 2:14 PM, Fred Marshall wrote: > > ... > >> Rather than being annoyed by the reality that both conventions and >> perspectives do exist, I think it's a lot better to just deal with it. > > Agreed, but it is annoying to be forced to use a convention that seems > poorly adapted to the application. If a boy is a year old on his first > birthday. how old is he on his birth day?
A whole day is a long timespan! Astrologers regard the moment of the first breath as ~the~ time of birth. Seems reasonable. So, depending on when you make the measurement, he is N seconds/minutes/hours...years from that first breath. Measuring age purely in terms of year units is, er, a heavily quantised procedure, generally only accepted after the first two years or so have passed. But - from that moment of birth, he is in his first year, not his zeroth. Cardinal v ordinal, blah blah...and his "first" birthday is the first celebration of that particular time interval having elapsed. And of course it is a calendar year, the same numerical date in the month - so the whole exercise is more numerological than temporal. Astrologers, being far more scientific about such things, speak in terms not of birthdays but of "solar returns". One interesting and popular case where humans count from zero is counting downwards: "ten, nine, eight...one, bang!". So if we were to reverse time back towards birth, with a count-down, we can see that the moment of birth itself is indeed at t=0, and is universally agreed to be such. It only gets to be weird in films, where for some reason, they seem to be counting intervals much longer than a second. And, when the scene briefly changes, as often as not, the countdown is magically suspended as well. So counting, as distinct from mere measuring, is very much something done by humans, on a whim, in their own sweet time. Richard Dobson
robert bristow-johnson <rbj@audioimagination.com> wrote:

(snip, someone wrote)
>> Which shows again that "overtone" and "harmonic" aren't synonyms.
> yup. for multiple reasons. "harmonic" implies an integer multiple of > some common fundamental. there are instruments (like bells) that have > overtones that are not integer multiples of a common fundamental. unless > that fundamental is a contrived frequency that is very, very low.
For musical instruments, the overtones are pretty much never exact harmonics, but are often close enough for musical purposes. Consider the equal-tempered scale, where half tones are a factor of the twelfth root of two apart. That is, apparently, close enough for musical purposes. (As noted in a previous thread, the ear resonators have a low Q, so it is difficult to measure such exactly.) For actual instruments, the stiffness of strings (especially piano wire), and the finite cross section of wind instruments, tends to cause small shifts in the partials. For crystal oscillators, also, the overtones are not exact multiples. Not so far, but when specified to six or seven digits the difference is pretty large. Overtone mode crystals, then, are cut such that the specified overtone equals (within tolerance) the specified frequency. It seems, though, that overtone crystals are numbered in the same manner as harmonics, (fundamental is one), and not the way that musicians number them.
> given > whatever precision of measurement of frequency, you can always find a > greatest-common-factor of all the overtones and then call them "harmonic".
-- glen
Richard Dobson <richarddobson@blueyonder.co.uk> wrote:

(snip)
> A whole day is a long timespan! Astrologers regard the moment of the > first breath as ~the~ time of birth. Seems reasonable. So, depending on > when you make the measurement, he is N seconds/minutes/hours...years > from that first breath. Measuring age purely in terms of year units is, > er, a heavily quantised procedure, generally only accepted after the > first two years or so have passed. But - from that moment of birth, he > is in his first year, not his zeroth. Cardinal v ordinal, blah > blah...and his "first" birthday is the first celebration of that > particular time interval having elapsed. And of course it is a calendar > year, the same numerical date in the month - so the whole exercise is > more numerological than temporal. Astrologers, being far more scientific > about such things, speak in terms not of birthdays but of "solar returns".
As I understand it, the traditional Chinese counting system starts at one (birth) and increments on the Chinese new year (lunar calendar based). Presumably it made more sense thousands of years ago. Now that we have to get driving age or drinking age correct, counting solar years makes more sense. (Though logically one should correct the age for premature births, though I don't know that anyone does that.) -- glen
On Aug 27, 3:30&#4294967295;pm, robert bristow-johnson <r...@audioimagination.com>
wrote:
>... > > Why would I need to read the archive from beginning to end? > > ostensibly to check whether Dijkstra actually said what was attributed > to him (he didn't), but the real reason is to actually read through the > whole thing to be fully exposed to the case that Dijkstra makes. >
No, really, why? Having actually read Dijkstra's remarks, it is clear that he had nothing new or original to add to the topic. The only stated preference is a subjective "nicer". He neither claims or presents a technical basis or motivation for a choice between zero and one. And it was clear from the beginning that Dijkstra wouldn't do anything as silly as try to present a matrix oriented language like Matlab as a straw-man in the counting from zero/one romp. Dale B. Dalrymple
On Aug 28, 7:41&#4294967295;pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> Richard Dobson <richarddob...@blueyonder.co.uk> wrote: > > (snip) > > > A whole day is a long timespan! Astrologers regard the moment of the > > first breath as ~the~ time of birth. Seems reasonable. So, depending on > > when you make the measurement, he is N seconds/minutes/hours...years > > from that first breath. Measuring age purely in terms of year units is, > > er, a heavily quantised procedure, generally only accepted after the > > first two years or so have passed. But - from that moment of birth, he > > is in his first year, not his zeroth. Cardinal v ordinal, blah > > blah...and his "first" birthday is the first celebration of that > > particular time interval having elapsed. And of course it is a calendar > > year, the same numerical date in the month - so the whole exercise is > > more numerological than temporal. Astrologers, being far more scientific > > about such things, speak in terms not of birthdays but of "solar returns". > > As I understand it, the traditional Chinese counting system starts > at one (birth) and increments on the Chinese new year (lunar calendar > based). &#4294967295;Presumably it made more sense thousands of years ago. > > Now that we have to get driving age or drinking age correct, > counting solar years makes more sense. &#4294967295;(Though logically one > should correct the age for premature births, though I don't know > that anyone does that.) > > -- glen
Just do like they do with thoroughbreds, they are all born on Jan 1st of the year in which they are born. So the race horse breeders time the conceptions to have the mares all foal in January. But if they foal in December, the foals are already older (by definition) and at a huge disadvantage for racing. Clay
On 8/28/2011 1:37 AM, Fred Marshall wrote:
> On 8/27/2011 9:19 AM, Jerry Avins wrote: >> On 8/27/2011 12:09 PM, Richard Dobson wrote: >> >> ... >> >>> Similarly, the fundamental is the first harmonic, among possibly many >>> (where "harmonic" may be understood as "mode of vibration"). OK, if you >>> want, the "zeroth harmonic" is DC, but that will always be somewhat >>> contrived in language. Presented with a basket of ten apples, we count >>> the apples to give the answer ten (and, no doubt, counted from one to >>> ten inclusive), not eleven to include the basket itself, which is >>> content-agnostic, just as DC is harmonic-agnostic. Everyday speech is >>> almost exclusively ordinal in character, while cardinal counting from >>> zero remains the best programmatic use of the available range of a >>> number, etc etc etc. So programmers will continue counting from zero, >>> hoping the zeroth apple will be available to consume, while all other >>> carbon-based lifeforms, including musicians fretting about harmonics, >>> will continue happily counting from one. >> >> Calling DC the zeroth harmonic makes good mathematical sense. Symmetric >> distortion produces only odd harmonics, normally including the first. >> Asymmetric distortion produces also even harmonics, normally including >> the zeroth, an offset. >> >> For me, it also makes esthetic sense. >> >> Jerry > > Yes and note that after all the very logical discussion of which > notation he likes the best [that is (a)], he goes on to say: > "So let us let our ordinals start at zero: an element's ordinal > (subscript) equals the number of elements preceding it in the sequence." > > That's all well and good but having the element's ordinal equal the > number of elements *preceding it* in the sequence assumes always > sequences that start at zero *AND* that one "likes" this odd convention. > > I usually think: 0 to 255 and not 0 and less than 256 > I usually think: 0 to 255 as having 255+1 elements or x to y having > (y-x)+1 elements. > I don't usually think: 1 to 255, now let's see, the next ordinal would > be 255+1 = 256 so THERE's the number of elements in 0 to 255. > I don't usually think: 2 to 255, now let's see, the next ordinal would > be 255+1 less 2 would be 254. Rather, as above, 255-2+1=254 ... which > looks a lot like 255+1-2 :-) > > But, knowing where Dijkstra is coming from gives pause to consider the > validity of his arguments nonetheless. If I'm not *thinking* about it > but, rather, writing code then OK. Maybe (a) really is good coding > notation but I've not pondered it....
My power went off Sunday and came back on Thursday night. I never got the generator power to my computer and router, so I was out of touch. My Sony battery-operated radio has 100 preset stations, arranged in ten pages of ten stations each. Interestingly, they are numbered 0-9. I assume that's not for any deep philosophical reason, but because the buttons on the keypad are also numbered 0-9. Jerry -- Engineering is the art of making what you want from things you can get.
On Aug 26, 10:13&#4294967295;pm, Jerry Avins <j...@ieee.org> asked:

> 2. Why are push-pull amplifiers standard for low-distortion
applications?
> 3. Is a graph of cos(wt) + D*cos^2(wt) symmetric? How about a graph > &#4294967295; &#4294967295; of cos(wt) + D*cos^3(wt)? &#4294967295;(Choose D large enough to be seen.)
Here, presumably symmetry means no DC component. There are many ways of defining symmetry. The graph of f(x) = D*x^2 has symmetry in the sense of being an even function of x. Indeed, for *any* f(x), the function g(x) = f(x) - f(-x) is an *odd* function of x, and could be considered *antisymmetric* in the sense that g(-x) = -g(-x). In particular, g(0) = 0. If f(x) is a polynomial, then g(x) has terms of odd degree only, and Jerry's statement
>Symmetric distortion implies the presence of >only odd harmonics, 1st, 3rd, 5th, etc.
is saying that if there is no DC component in the response to a sinusoidal input, then f(x) has only odd degree terms. Indeed, since a typical f(x) is of the form Ax + Bx^2 + Cx^3 where A >> B > C, eliminating the quadratic term reduces distortion considerably. Creating an odd function of x via f(x) - f(-x) is the idea behind the push-pull amplifier referred to by Jerry, thereby eliminating even-order harmonics (including DC). On a semi-related matter, I have no problems with the FIRST overtone being the same as the SECOND harmonic. After all, one cannot have an OVERtone unless one has a tone to begin with! But, I do worry that r b-j and Dijkstra will want to call it the zero-th overtone..... :-) Dilip Sarwate