| > To Continue with Chapter 3
Phasors But before we go too far, it's important to fully understand what a sinewave is, and it's also wonderful to know that we can make these simple little curves ridiculously complicated too. Nonetheless, it's useful to have another model for generating these functions. That model is called a phasor, just like the Star Trek handgun.
Think of a bicycle wheel suspended at its hub. We're going to paint one of the spokes a bright red and at the end of the spoke we'll put a red arrow. We now put some axes around the wheel the x-axis going horizontally through the hub and the y-axis going vertically. We'll be interested in the height of the arrowhead relative to the x-axis as the wheel our phasor spins around counterclockwise. As the sinewave moves forward in time, the arrow goes around the circle at the same rate. The height of the arrow (that is, how far it is above or below the x-axis) as it spins around in a circle, is described by the sinewave. In other words, if we trace the arrows location on the circle (from 0 to 2 Thanks to: George Watson, Dept. of Physics & Astronomy |University of Delaware, ghw@udel.edu, for this animation. As time goes on the phasor goes round and round. At each instant we measure the height of the dot over the x-axis. Let's do a small example first. Suppose the wheel is spinning at a rate of one revolution per second. This is its frequency (and remember, this means that the period is 1 second/revolution). This is the same as saying that it spins at a rate of 360 degrees per second, or better yet, 2\2 This means that after .25 seconds the phasor has gone
The sine and cosine of an angle are measured using a right triangle. For our right triangle below, the sine of
Installed
In general, if our phasor was moving at a frequency of
You can do some checking on your own and see that this is also the graph that you would get if you plotted the displacement of the arrow from the y-axis. So, we now know that a cosine is a phase-shifted sine!
Adding Phasors In particular, if the function has period T (don't ask us why we use T to represent the period, that's just the way it is it probably came from "time" of revolution) then this sum looks like: If T is the period of our periodic function, then we now know that its frequency is 1/T this is also called the fundamental (frequency) of the periodic function, and now we see that all other frequencies that occur (called the partials) are simply integer multiples of the fundamental. If you read other books on acoustics and DSP, you will find that partials are sometimes called overtones, from an old German word (übertonen), and harmonics. There's often confusion about whether the first overtone is the second partial, etc. So, to be specific, and also to be more in keeping with modern terminology, we're going to always call the first partial the one with the frequency of the fundamental.
Our regular old numbers can be thought of as arrows on the number line. Adding any two numbers then simply means taking the two corresponding arrows and placing them one after another, tail to tail. The sum is then the arrow from the origin pointing to the place where "adding" the two arrows landed you. Really what we are doing here is thinking of numbers as vectors. They have a magnitude (length) and a direction (in this case, positive or negative, or better yet, 0 radians or Now to add phasors we need to enlarge our world view and allow our arrows to not just get 2 directions, but instead, a whole 2 (If you want to impress your friends, tell them that you've just learned how to do vector arithmetic! They will think you very cool. That's why they're avoiding you really!) So, to recap: to add phasors we do the following: at each instant as our phasors are spinning around we add the two arrows. In this way get a new arrow spinning around (the sum) at some frequency a new phasor. Now it's easy to see that the sum of two phasors of the same frequency yields a new phasor of the same frequency so for example it is easy to see that the sum of a cosine and sine of the same frequency is simple a phase-shifted sine of the same frequency with a new amplitude given by the square-root of the sum of squares of the two original phasors. That's just the Pythagorean Theorem! Sampling and Fourier Expansion
The decomposition of a complex waveform into its component phasors (which is pretty much the same as saying the decomposition of an acoustic waveform into its component partials) is called Fourier expansion. In practice, the main thing that happens is that analog waveforms are sampled, creating a time domain representation inside the computer. These samples are then converted (using what is called a Fast Fourier Transform, or FFT) into what are called Fourier coefficients.
This is a phenonemon that happens when we try to sample a frequency which is more than half the sampling rate, or the Nyquist frequency. As the frequency we want to sample gets higher than half the sampling rate, we start "undersampling" and get unwanted, lower frequencies artifacts. We'll learn lots more about it in a later chapter This picture is a common way to show timbral information, especially the way that harmonics add up to produce a waveform. However, it can be slightly confusing. By running an FFT (Fast Fourier Transform) on a small time slice of the sound, the algorithm gives us the energy in various frequency bins The x-axis (bottom axis) shows the bin numbers. The y-axis shows the strength (energy) of each partial. The slightly strange thing to keep in mind about these bins is that they are not based on the frequency of the sound itself, but on the sampling rate. In other words, the bins evenly divide the sampling frequency (linearly, not exponentially, which is a problem!). Also, this plot just shows a short fraction of time of the sound to make it time-variant, we need a waterfall 3D plot (we've seen a bunch of these in this book). Although theoretically, we could use this information in its raw form to make a lovely, synthetic gamelan sound, the complexity and idiosyncracies of the FFT itself make this a bit difficult (unless we simply use the data from the original, but that's cheating...). The picture below shows a better graphical representation of sound in the frequency domain. Time is running from front to back, height is energy, and the x-axis is frequency. This picture also takes the essentially linear FFT, and shows us an exponential image of it, so that most of the "action" happens in the lower 2k, which is correct. (Remember that the FFT divides the frequency spectrum into linear, equal divisions, which is not really accurately how we perceive sound it's often better to graph this exponentially so that there's not as much wasted space "up top"). Note that the waterfall plot below is stereo, and each channel of sound has its own slightly different timbre! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||