# Trigonometry/Phase and Frequency
## Frequency

Here are some sinusoidal (that is 'sine like') graphs. These show sinusoidal waves with different frequency. The frequency increases as you go down.
* Waves and Light
* In physics, light is a kind of wave, and different frequencies of light give the different colors of the spectrum.
* Does red light have a higher or lower frequency than blue light?
* In a rainbow is red on the outside or the inside of the rainbow? What about a double rainbow? (use the Internet)
* Are radio waves higher or lower frequency than light waves? (use the Internet)
* Waves and Sound
* In physics sound is a kind of wave. It's physically a different kind of wave from light, but its vibrations can still be described using sines and cosines. Light is an electromagnetic wave and sound is a wave involving change in air pressure. That difference is the underlying reason why light can travel through the vacuum of space, but sound cannot.
* High pitched notes are high-frequency sound waves. Low pitched notes are low-frequency sound waves.
* Find out what the highest frequency of hearing is for humans and for bats. (use the Internet)
* Explain in your own words what 'Hertz' means, and what the K in the abbreviation KHz means.
* What vibration frequencies are typical in an Earthquake?

## Sine and Cosine Graphs

And here in this graph, the colors we've chosen to draw the waves in have no relation to the frequency. Both waves have the same frequency, but we've used different colors.
Notice that in the graph of sine and cosine above that the two graphs have the same shape. If we slide the sine graph slightly to the left, it coincides exactly with the cosine graph. Using the terminology used to describe sinusoidal waves, they have the same amplitude, the same frequency and different phases.

## Definitions

A sinusoidal wave is characterized by three parameters: amplitude, frequency and phase.
* The amplitude is the amount the function varies, positively or negatively, from zero in the y direction.
* The frequency is how many complete cycles there are of the wave in unit distance on the x axis (which often measures time)
* The phase is relevant when comparing two waves of the same frequency. It is how much (measured in degrees or radians) one is shifted relative to the other on the x axis.
This terminology comes from sound engineering where higher frequency sounds have higher pitch and waves of greater amplitude are louder.
As an alternative to specifying the frequency, the number of cycles in unit distance, we can instead specify the wavelength, the length of one cycle. The higher the frequency, the shorter the wavelength. The lower the frequency the longer the wavelength.
You can check this on the diagram of waves of different frequencies at the top of the page.

## In More Detail

To fully understand how each of the following definitions relate, look at the graph of the function $f(t)=4\sin \left({\frac {\pi }{6}}t\right)+40$ below (left). For the figure representing (a)-(b), read the corresponding definitions.

### Amplitude

The amplitude is the maximum amount that the wave differs from the sinusoidal axis value, $c$ – the value by which the function is shifted by the average of the maximum to the minimum range of the function, ${\frac {y_{max}+y_{min}}{2}}$. The amplitude comes from two different locations: the maximum value minus $c$ or the minimum value minus $c$. The positive magnitude of the value is taken (absolute value). Look at the data below for an example.
${\begin{array}{|c|c|}x&g(x)\\\hline 0&20\\\hline 2&0\\\hline 4&-20\\\hline 6&0\\\hline 8&20\\\hline \vdots &\vdots \end{array}}\!$
Let us not worry about finding the function for this set of data for now. Instead, focus on finding the amplitude. The maximum $y$-value $y_{max}=20$. The minimum $y$-value $y_{min}=-20$. Therefore, ${\frac {20+(-20)}{2}}={\frac {0}{2}}=0$. The maximum difference comes from two different locations: the maximum value minus the sinusoidal axis value or the minimum value minus the sinusoidal axis value. In this example, we will choose to use the difference between the maximum value to the sinusoidal axis value, which is $20-0=20$. Therefore, the amplitude of the above data is $20$.
In general, for $\sin(b\theta )+c$ and $\cos(b\theta )+c$ (where $b>0$) the amplitude is 1. For $a\sin(b\theta )+c$ and $a\cos(b\theta )+c$ (where $a>0$ and $b>0$) the amplitude is $a$. The difference between the greatest and least value is called the double amplitude or peak to peak amplitude. Knowing this, the way to find the amplitude given the greatest and least value of the range is to take the difference between the two and then divide by 2:
    $a={\frac {y_{max}-y_{min}}{2}}$.

### Frequency

The frequency (sometimes $f$) is the number of cycles a wave goes through in a standard distance or time. If this standard distance is $360^{\circ }$ or $2\pi$ radians, the frequency of $\sin(\theta )$ and $\cos(\theta )$ is $1$, and that of $\sin(b\theta )$ and $\cos(b\theta )$ is $b$. A graph of a high frequency wave shows more complete cycles in the same horizontal span as a low frequency wave. Notice $b$ is the frequency value, $f$, so $b=f$.
The wavelength (or period), $\lambda$, decreases as the frequency increases. Mathematically, this relationship is written as $\lambda \propto {\frac {1}{f}}$ (the wavelength is inversely proportional to the frequency). It is the distance over which a complete cycle occurs, that is, the wave goes from $c$ to its maximum positive value, back to $c$, down to the lowest negative value, then back up to $c$.
The functions $\sin(\theta )$ and $\cos(\theta )$ both go through a complete cycle as the angle increases by $360^{\circ }$ or $2\pi$ radians, hence this is the wavelength. The functions $\sin(b\theta )$ and $\cos(b\theta )$ (where $b$ is any positive number) go through one cycle as the angle $\theta$ increases by ${\frac {360^{\circ }}{b}}$ or ${\frac {2\pi }{b}}$ , hence their wavelength $\lambda ={\frac {360^{\circ }}{|b|}}$ or $\lambda ={\frac {2\pi }{|b|}}$ . This makes sense, because if $b=f$ and $\lambda ={\frac {2\pi }{|b|}}$ , then $\lambda \propto {\frac {1}{b}}$ .
Finally, using wavelength, one can directly find the frequency. If $\lambda ={\frac {2\pi }{|b|}}$, then
    $\Rightarrow \lambda \times {\frac {1}{\lambda }}\times b={\frac {2\pi }{b}}\times b\times {\frac {1}{\lambda }}$
    $\Rightarrow b={\frac {2\pi }{\lambda }}$

### Phase Shift

The phase is the fraction of the cycle that you have reached at any given point. If the point is not specified, it may be assumed to be 0°. The start of the cycle is the point where the wave is 0 and going from negative to positive. (If the wave is not a sine curve, there may be more than one such point in a complete cycle so the starting point may be arbitrary.) For $\sin(\theta )$ the phase at 0° is 0; for $\cos(\theta )$ it is ¼. If the cycle has wavelength $360^{\circ }$ or $2\pi$ radians, the phase is often expressed as an angle corresponding to the given fraction of the wavelength, so the phase of $\cos(\theta )$ at 0° is $90^{\circ }$ or ${\tfrac {\pi }{2}}$ radians.
It is assumed that the average value of the wave is 0. If the wave is say $\sin(\theta )+4$ or $2\pi$ , it is never 0 so to define the phase we would need the point where it reaches its average value (4 in this case).

## Examples

* Larger Amplitude
* $10\cos(\theta )$
* has ten times the amplitude of $\displaystyle \cos \theta$
* The graph oscillates between 10 and -10 on the y axis.
* Larger Frequency
* $\cos(100\theta )$
* has a higher frequency than $\cos(\theta )$
* There will be 100 times as many cycles in the same distance along the x axis. The amplitude is unchanged.
* The wavelength is also decreased. The distance along the x axis for a complete cycle is one hundredth of what it was before.
* Different Phase
* $\sin(\theta )$
* has a different phase from $\cos(\theta )$ . The phase difference happens to be 90°, because $\sin(\theta +90^{\circ })=\cos(\theta )$ . If two waves are 180° out of phase then where one is positive the other has the same value only negative. $-\sin(\theta )$ is 180° out of phase with $\sin(\theta )$

## Offset

Two sinusoidal waves may also have a different offset to each other, i.e. their average values are different, but they still have the same shape. Their graphs are y shifted relative to each other. In sound engineering this is called DC Bias.
* Different Offset
* $1+\cos(\theta )$
* has a different offset to $\cos(\theta )$ . Whereas $\cos(\theta )$ takes both positive and negative values, $1+\cos(\theta )$ is never below 0.
This offset is based off the vertical shift, also known as the sinusoidal axis value. Keep in mind, unlike other functions, this vertical shift does not denote the y-intercept. The only way to determine the y-intercept correctly is to substitute zero into a function. Quick quiz: what is $\cos(0)$? In case you forgot, it is $1$. Therefore, the y-intercept for $f(\theta )=1+\cos(\theta )$ is $f(0)=1+\cos(0)=1+1=2$.

## The Graphs and Their Differences

Comparing and contrasting two different items may seem like a pointless task to the student, at first. However, the purpose of such an activity is to make students analyze information and help cement differences between the two ideas. Here, it is imperative that the student understands the differences between cosine and sine because otherwise, the student is not able to model situations correctly! While this Wikibooks will not make the student analyze the two functions themselves, it may be a good idea to remember the differences.

### The parent functions

The sine and cosine functions are shown above, where $0\leq x\leq 2\pi$. Notice that the frequency and period of the functions are both identical. Given that these are also parent functions, the vertical shift is zero. However, the similarities start to end. First, look at the pattern of the function. Over $\lambda =2\pi$, the periodic function $\sin(x)$ follows the basic pattern of "middle," "top," "middle," "bottom," "middle." That is, the value of $f(x)=\sin(x)$ starts at $f(0)=0$. However, $f\left({\frac {\pi }{2}}\right)=1$. This is the highest possible value of sine when looking at the positive values, because the unit circle is peaked when $\theta ={\frac {\pi }{2}}$. At $x=\pi$, $f\left(\pi \right)=0$. This has again to do with the unit circle. If you remembered the patterns you identified in the circle (or even the unit circle itself) you can infer how$f(x)=\sin(x)$will look like. The minimum value of the range is at $-1$ precisely for this reason. As such, the pattern we identified is always true.
By contrast, the cosine function follows a more simplistic pattern. For $g(x)=\cos(x)$, you already start at the maximum value because $g(0)=\cos(0)=1$ is the largest $x$-value on the circle, while$g\left(\pi \right)=\cos \left(\pi \right)=-1$ is the lowest $x$-value on the circle. Because of the unit circle, the simplistic pattern results: "maximum," "medium," "minimum," "medium," "maximum."
The patterns mentioned above are things that you should keep in the back of your mind. These patterns are the main ways in which a person can easily identify when to use one particular function over another. When a phase shift is applied, choosing to use a cosine function or a sine function is best left to student judgement.
From the information we have so far, we get the following information:
* The vertical shift $c={\frac {y_{max}+y_{min}}{2}}={\frac {1+(-1)}{2}}={\frac {0}{2}}=0$.
* The amplitude $a={\frac {y_{max}-y_{min}}{2}}={\frac {1-(-1)}{2}}={\frac {2}{2}}=1$.
* The frequency $b={\frac {2\pi }{\lambda }}={\frac {2\pi }{2\pi }}=1$.
The general form of the sinusoidal function is
$A\sin(B(x-D))+C$
* The sine can be substituted for cosine and it would work just the same.
* $A$ is the amplitude.
* $B$ is the frequency.
* $C$ is the vertical shift (sinusoidal axis value).
* $D$ is the phase (horizontal) shift.
We have described the general pattern for the cosine and sine functions. However, it is important to step back and appreciate the underlying math for which the cosine and sine curves rely on, the unit circle. While these functions are beautiful, the underlying math behind why these functions behave the way they do is the reason for this beauty, and in a way, makes it more beautiful than the end result.
Draw two circles with radii $r$ and $R$ centered at the origin, where $r<R$. If a line extending from the origin reaches an endpoint of each circle at the angle $\theta$, then $\cos \theta ={\frac {x_{1}}{r}}$, and $\cos \theta ={\frac {x_{2}}{R}}$. As such,
* $x_{1}=r\cos \theta$
* $x_{2}=R\cos \theta$
Because $\cos \theta$ is multiplied directly to $r$ or $R$, for $r<R$, $r\cos \theta <R\cos \theta$.
Let $f(\theta )=r\cos \theta$, $g(\theta )=R\cos \theta$, and $r=1$. Because we know how to graph $f(\theta )=\cos \theta$, $R$ is multiplied directly to $\cos \theta$, and $g(\theta )=Rf(\theta )$, the resulting function must be "expanded" over the $y$-axis. This expansion must be related to the amplitude of the function, because $Ry_{max}$ and $Ry_{min}$ gives ${\frac {Ry_{max}-Ry_{min}}{2}}={\frac {R\left(y_{max}-y_{min}\right)}{2}}=R\cdot {\frac {y_{max}-y_{min}}{2}}=Ra=R$. (Recall $a=1$).
* The amplitude of the function is given by the radius of the circle.
* Changing the radius of the circle does not change the frequency, the vertical shift, or the phase shift. (Exercise: show that this is true for at least the frequency and the vertical shift.)
This result will be useful when working with problems later.
As of now, increasing the radius is all that we could connect these sinusoidal functions to the circle. We need to understand more about additions and such before one can address the beauty of this math. Nevertheless, always keep this result locked in your heart.

## Modeling Situations

The sinusoidal functions are very useful in real life applications, where these periodic (repeating) functions model situations that follow a pattern over a set amount of time, such as in modeling day length, planetary motion, sound waves, energy waves, etcetera.
* Fish length
* Marine biologists determined the average length of $N=50,000$ fish in a pond in millimeters (mm) is dependent on the time, in years. The table is shown below, where $t$ is the time, in years, and $l(t)$ is the average length of the fish, in millimeters. Find the sinusoidal function that best models the information provided.
* ${\begin{array}{|c|c|}t&l(t)\\\hline 0&44\\\hline 3&40\\\hline 6&36\\\hline 9&40\\\hline 12&44\\\hline \vdots &\vdots \end{array}}\!$
* The situation is given to be periodic and sinusoidal. Therefore, it is best to use the sinusoidal function and its properties: $a{\text{ trig}}(b(x+d))+c$.
* Find the vertical shift, $c$. Recall that $c={\frac {y_{max}+y_{min}}{2}}$. According to the table, the maximum y-value is 44, while the minimum value is 36. Therefore, the vertical shift is
* ${\frac {44+36}{2}}=40$
* Find the amplitude, $a$. Recall that $a={\frac {y_{max}-y_{min}}{2}}$. According to the table, the maximum y-value is 44, while the minimum value is 36. Therefore, the amplitude is
* ${\frac {44-36}{2}}=4$
* Find the frequency, $b$. Recall that $b={\frac {2\pi }{\lambda }}$. If the wavelength is the distance whereby a complete cycle occurs, then from $t=0{\text{ sec}}$ to $t=12{\text{ sec}}$, the cycle is complete. As such, $\lambda =12-0=12$. Given this information,
* $b={\frac {2\pi }{12}}={\frac {\pi }{6}}$
* For now, let us ignore the phase shift, $d$. Substitute the information we already know into the function above: $4{\text{ trig}}\left({\frac {\pi }{6}}t\right)+40$. Recall that a sinusoidal function that has a maximum value reappear again over a wavelength (from maximum to medium to minimum to medium to maximum) is cosine. As such $4\cos \left({\frac {\pi }{6}}t\right)+40$ models the situation sufficiently.
* Equivalently, assuming we want to keep it in terms of sine, we know the following is true:
* $\cos \left(\theta \right)=\sin \left({\frac {\pi }{2}}-\theta \right)=\sin \left({\frac {\pi }{2}}+\theta \right)=-\sin \left(\theta -{\frac {\pi }{2}}\right)$
* Therefore, $4\cos \left({\frac {\pi }{6}}t\right)+40=4\sin \left({\frac {\pi }{6}}\left({\frac {\pi }{2}}-t\right)\right)+40=4\sin \left({\frac {\pi }{6}}\left({\frac {\pi }{2}}+t\right)\right)+40=-4\sin \left({\frac {\pi }{6}}\left(t-{\frac {\pi }{2}}\right)\right)+40$.
The above question is comparatively easier to other similar problems like this. In the real world, you are less likely to see a steady increase/decrease in fish length because of two factors:
* Evolution: bigger fish are usually seen as predators, which are often avoided. Smaller fish are more likely to be seen as weaker.
* Internal Competition: size among females may be seen as more desirable as mates, and therefore more likely to pass on offspring with those traits. As such, competition may exist among females for desirable mates.
There are many questions a person may be asking: where is the above circle in the question? Why use radians as opposed to degrees? . There are a few reasons, but it requires us to delve more deeply into mathematics that is usually considered advanced (polar coordinates). Unfortunately, Book 1 will not delve into this topic. However, for those that are curious, Book 3 will have polar coordinates that fully explain this behavior.
| previous module: "Graphs of Sine and Cosine Functions" | • Table of Contents | next module: "Graph of Sine Squared" |