Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!zephyr.ens.tek.com!orca!ka7axd.WV.TEK.COM From: mhorne@ka7axd.WV.TEK.COM (Michael T. Horne) Newsgroups: comp.dsp Subject: Re: Pitch shift / offset and FFT Message-ID: <4754@orca.WV.TEK.COM> Date: 29 Sep 89 08:05:20 GMT References: <4384@internal.Apple.COM> <89264.171306P85025@BARILVM.BITNET> <9520001@hpsad.HP.COM> <1787@draken.nada.kth.se> <4725@orca.WV.TEK.COM> Sender: news@orca.WV.TEK.COM Reply-To: mhorne@ka7axd.WV.TEK.COM Organization: Tektronix, Inc., Wilsonville, OR Lines: 97 In a recent article by Steve Wasserman: >> >>...Nothing magical happens; Any perceived beating >>between the two (or more) sinusoids, such as what your ear hears, is caused >>by the mixing (multiplying) action of the ear itself (with a little help from >>the brain :)... > >...I disagree with >you slightly - beating is *not* caused by your ears and brain, it >really happens. > >Algebraically, this is: > >exp(j*f1* t) + exp(j*f2*t) = exp[j*t*(f1-f2)/2] * exp[j*t*(f1+f2)/2] + > exp[j*t*(f2-f1)/2] * exp[j*t*(f1+f2)/2] > >where f1 and f2 are the two angular frequencies and exp() is >exponentiation (e to the x). Taking the real part of both sides: > >cos(f1*t) + cos(f2*t) = cos[t*(f1-f2)/2]*cos[t*(f1+f2)/2] - > sin[t*(f1-f2)/2]*sin[t*(f1+f2)/2] + > cos[t*(f2-f1)/2]*cos[t*(f1+f2)/2] - > sin[t*(f2-f1)/2]*sin[t*(f1+f2)/2] > >We can simplify this because we know thet f2-f1 = -(f1-f2), >sin(-a)=-sin(a), and cos(-a) = cos(a). The answer is: > >2*cos[t*(f1-f2)/2]*cos[t*(f1+f2)/2] > >Which really does get louder and softer. In our case, we have: > >v = 2*cos[2*pi*50*t]*cos[2*pi*1050*t] What you have shown, Steve, is a rather thorough example of a trig identity. Take for example any given sinusoid represented as a complex exponential. Maintaining the same notation that you have used, we can represent it as a product of two exponentials: exp(j*f1*t) = exp(j*t*(f1+f2)/2) * exp(j*t*(f1-f2)/2) (1) where f1, f2 are any arbitrary angular frequencies. It can be readily shown that you can represent a single sinusoid as the sum-of-products of sum/difference sinusoids. Taking the real part of both sides of (1) above: cos(f1*t) = cos(t*(f1+f2)/2) * cos(t*(f1-f2)/2) - (2) sin(t*(f1+f2)/2) * sin(t*(f1-f2)/2) I think that most of us are aware of the common trig identity: cos(u+v) = cos(u)*cos(v) - sin(u)*sin(v) (3) letting u = t*(f1+f2)/2, and v = t*(f1-f2)/2, and applying it to (3) we obtain: cos(t*(f1+f2+f1-f2)/2) = cos(t*(f1+f2)/2) * cos(t*(f1-f2)/2) - (4) sin(t*(f1+f2)/2) * sin(t*(f1-f2)/2) which is of the same form as (2). For example, letting f1 = 5, f2 = 1, you get: cos(5t) = cos(3t + 2t) = cos(3t)*cos(2t) - sin(3t)*sin(2t) (5) In this example, we have shown that we can create a sinusoid with angular frequency 5 by simply taking the difference (or sum, however you wish to look at it) between the product of two cosines (one of frequency 3 and one of frequency 2), and the product of two sines (of the same frequencies). This identity applied in this manner is also expandable to additional "sums" (i.e. cos(u+v+w)), even though it ultimately reduces to a single frequency. One can easily argue that when you sum two sinusoids, you get `beating' effects. Steve's example above shows just such an apparent beating phenomenon; However, it actually is just a unique arrangement of terms that represent the sinusoids in forms similar to (2) above, grouped together to form what appears to be an actual mix (multiplication) of frequencies other than the original sums. As I've shown above, even though you can manipulate an equation to show this apparent multiplication, it still reduces to a single, simple sinusoid. This same rule holds for the sum of two sinusoids, that is: sin(u) + sin(v) = sin(u) + sin(v) regardless of how u and v are represented. What all of this shows (through both Steve's comments and mine) is that it can be viewed either way; however, one must always remember that in reduced form, it still is only a sum. Summing two sinusoids does not generate additional sinusoids; However, a non-linear operation such as mixing (multi- plying) *does* generate additional sinusoids. The two operations are very different. All in all, the math is beautiful, isn't it? :) >swass@apple.com Mike (Ever listen to two Piccolo Petes (fireworks) going off within a few seconds of each other? :)