Вы находитесь на странице: 1из 11

3/24/16

Java Project

Tim Miller

When listening to the sounds that the 100 Hz sine wave made it was a very low humming sound.
As you move the slider up and up on the playing frequency the sound pitch became higher and higher.
The t=0 is located at 0 on the graph. The frequencies that are reported with the 100 Hz sine wave are as
follows; 100, 201, 302, . etc. It goes on like this increasing by 101 or 100 every time until the ending
frequency is on 4945 Hz or higher depending on how many terms you have in your graph. At this time
after hitting clear all the magnitudes are zero for the sine wave. As you move the sliders for the harmonics
up or down to +/- 1 the sine wave begins to take shape. If you increase the first one to a positive one you
get a standard sine wave with a frequency of 100 Hz. As you begin to add more and more harmonics into
the fold the sine wave changes shape by adding more peaks and valleys to the mix making the sine wave
more complex. This can be seen in Figure 1. I chose to increase every other one to positive one for the
first few. As seen in Figure 1 the waveform added more and more peaks and valleys into the standard sine
wave. Sound wise this sounded like it changed the frequency of the sine wave as well as the reverberation
the sound makes. When comparing the yellow harmonics to the red waveform, I saw that every harmonic
had the same inflection points as the 100 Hz sine wave. While the frequency increases they still hit the
same inflection point that the 100 Hz wave hit. At these shared inflection points the red waveform is
getting closer and closer to a vertical asymptote, which it never reaches. As seen in Figure 2, you can see
at 1312 Hz harmonic is in line with a few of the oscillations on the red waveform only the harmonics
have a higher amplitude. A general equation can be found as Equation 1.
As for the cosine wave form the sound it makes at 100 Hz is identical of that to the sine wave in
the first section. Only this time the t=0 mark is at positive 1. The first slider on the waveform will move
the entire red waveform up or down +/- 1. As seen in Figure 3, I kept with the same pattern as in the sine
wave by increasing every other harmonic to a positive one. It is good to note that the same pattern of
increasing from 100, 201, 302, etc. continues the same in the cosine waveform. This time when sliding
the mouse over the harmonics without clicking to compare the yellow harmonics to the red waveform, I
noticed that they do not share a common inflection point like the sine waveform did. When adding these

3/24/16

Java Project

Tim Miller

terms to the cosine waveform I noticed that the sound pitch was much higher than the one in sine
waveform and it also layered the sounds on top of one another. Looking more at the yellow harmonics vs
the red waveform the peak and valleys of the cosine wave at 100 Hz became more and more positive or
negative as can be seen in Figure 4. Each added term after that just made the waveform oscillate faster
and more frequent during each of these periods. The general equation for the cosine wave can be seen as
Equation 2.
When applying a phase shift to the sine function, as you click through the phase shift you begin to
notice that the amplitude on the sine function goes to zero while the amplitude of the cosine function
climbs to one. This is shown in the coefficients going up and down as seen in Figure 5. This changes the
function from an odd function (sine) to an even function (cosine). Therefore, this changes the harmonics
from a sine wave to a cosine waveform.
For the triangle waveform starting with one term sounds and looks like a cosine wave. When
compared to the white triangle waveform the points arent as sharp they are more rounded on the red
waveform, as seen in Figure 6. As you increase the number of terms to twenty, the sound changes to a
weird humming noise and the red waveform closely matches the triangle waveform, as seen in Figure 7.
For the sawtooth waveform with one term the red waveform looks and sounds like a cosine wave. As we
increase the number of terms to twenty, the sound becomes more of a buzzing noise than a humming one
and the red waveform closely matches that of the white sawtooth pattern, as seen in Figure 8. As for the
square wave function with one term it looks and sounds like a sine waveform as seen in Figure 9. As you
increase the number of terms in the waveform the red wave matches that of the white square wave fairly
close, with sharp oscillations at the corners of the square wave. The sound of the wave was more high
pitched buzzing than that of the sawtooth one. This can be seen in Figure 10. What is happening in each
of these cases, as we increase the number of terms the amount of samples the applet has to draw from,
thus increasing the closeness to the real waveform. As for even and odd, the triangle is the only even
function, while the sawtooth and square waves are odd functions because they are based off of cosine and

3/24/16

Java Project

Tim Miller

sine waves respectively. When applying a phase shift to the square wave for example the function goes
from an even to an mixed function and changes the way coefficients act. You can see this difference when
comparing Figure 10 and 11. As you can see the sine wave still has some coefficients, while small ones,
and the cosine waveform has the second term above the +1 mark and then oscillates every other one from
positive to negative numbers while the coefficients are getting smaller. When changing the coefficients of
the square wave we can see that changing the lower frequency ones, for example 100 Hz changes how flat
the top of the square wave is. Above one and the line is fairly flat, as you lower the coefficient the line
becomes more rounded and starts to bring back the wave from shape of the sine wave. Whereas if you
raise the coefficient of a higher frequency term, the flat lines of the square wave start to oscillate like a
true sine wave, only for those sections though. The general equations for the triangle, sawtooth, and
square wave functions can be found as Equation 3, 4, and 5 respectively.
When hitting the clip button on any other function other than the square wave, the function
slowly becomes a square wave. When you hit rectify or full rectify it takes off all the negative portions of
the waveform making it only show the positive half of the wave form. When you hit the filter button, it
slowly filters the function to zero term by term making the function go to zero.
The Gibbs Phenomenon can be observed on this applet. When you start with a square wave with
one term the function resembles a normal sine wave. As you increase the terms for every odd term the
function slowly changes into the square wave. The phenomenon can be observed by adding more and
more terms. While we cannot get an exact representation of the square wave with a sine wave we can get
really close. This is the phenomenon, as you add more terms to the function the red wave gets flatter and
flatter to fit the square wave. Although you can keep adding terms you can never get a real representation
of the square wave, but you can get a good approximation. As you add more terms what is supposed to be
the flat parts on the red wave appear to become flat, but in reality they are just oscillating at a faster rate
and a smaller amplitude each time.

3/24/16

Java Project

Tim Miller

Equations:

Equation 1:

f ( t ) sin ( 2 kt ) dt

Equation 2:

f ( t ) cos ( 2 kt ) dt

Equation 3: f ( x )=

(n1 )/ 2

(1 )
8

2
2
n=1,3,5,
n

sin

( nTx )

1 1
1
n x
Equation 4: f ( x )= 2 n sin T
n=1

( )

4
1
n x
Equation 5: f ( x )= n sin T
n=1 ,3,5,

( )

3/24/16

Java Project
Figures:
Figure 1:

Figure 2:

Tim Miller

3/24/16

Java Project
Figure 3:

Figure 4:

Tim Miller

3/24/16

Java Project

Figure 5:

Tim Miller

3/24/16

Java Project
Figure 6:

Figure 7:

Tim Miller

3/24/16

Java Project

Figure 8:

Figure 9:

Tim Miller

3/24/16

Java Project

Figure 10:

Figure 11:

Tim Miller

3/24/16

Java Project

Tim Miller

Вам также может понравиться