|
|
Line 70: |
Line 70: |
|
&= \frac{8H}{T^2}\int_{-\frac{1}{4}T}^{\frac{1}{4}T}t\,\cos\left(n\omega_0t\right) \,dt + \frac{4H}{T}\int_{\frac{1}{4}T}^{\frac{3}{4}T}\left(-\frac{2}{T}t+1\right)\cos\left(n\omega_0t\right)\,dt\\ |
|
&= \frac{8H}{T^2}\int_{-\frac{1}{4}T}^{\frac{1}{4}T}t\,\cos\left(n\omega_0t\right) \,dt + \frac{4H}{T}\int_{\frac{1}{4}T}^{\frac{3}{4}T}\left(-\frac{2}{T}t+1\right)\cos\left(n\omega_0t\right)\,dt\\ |
|
&= \frac{8H}{T^2}\left[\frac{t}{n\omega_0}\sin(n\omega_0 t)+\frac{1}{n^2\omega_0 ^2}\cos(n\omega_0 t)\right]_{-\frac{1}{4}T}^{\frac{1}{4}T} + \frac{4H}{T}\left[\frac{-\frac{2}{T}t+1}{n\omega_0} \sin(n\omega_0 t) - \frac{2}{Tn^2\omega_0^2} \cos(n\omega_0 t)\right]_{-\frac{1}{4}T}^{\frac{3}{4}T}\\ |
|
&= \frac{8H}{T^2}\left[\frac{t}{n\omega_0}\sin(n\omega_0 t)+\frac{1}{n^2\omega_0 ^2}\cos(n\omega_0 t)\right]_{-\frac{1}{4}T}^{\frac{1}{4}T} + \frac{4H}{T}\left[\frac{-\frac{2}{T}t+1}{n\omega_0} \sin(n\omega_0 t) - \frac{2}{Tn^2\omega_0^2} \cos(n\omega_0 t)\right]_{-\frac{1}{4}T}^{\frac{3}{4}T}\\ |
|
&= \frac{8H}{T^2}\left[\left[\frac{\frac{1}{4}T}{n\frac{2\pi}{T}}\sin\left(n\frac{2\pi}{T}\frac{1}{4}T\right)+\frac{1}{n^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\frac{1}{4}T\right)\right] - \left[\frac{-\frac{1}{4}T}{n\frac{2\pi}{T}}\sin\left(n\frac{2\pi}{T}-\frac{1}{4}T\right)+\frac{1}{n^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}-\frac{1}{4}T\right)\right]\right] + \frac{4H}{T}\left[\left[\frac{-\frac{2}{T}\left(\frac{3}{4}T\right)+1}{n\frac{2\pi}{T}} \sin\left(n\frac{2\pi}{T}\frac{3}{4}T\right) - \frac{2}{Tn^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\frac{3}{4}T\right)\right] - \left[\frac{-\frac{2}{T}\left(-\frac{1}{4}T\right)+1}{n\frac{2\pi}{T}} \sin\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right) - \frac{2}{Tn^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right)\right]\right]\\ |
|
&= \frac{8H}{T^2}\left[\left[\frac{\frac{1}{4}T}{n\frac{2\pi}{T}}\sin\left(n\frac{2\pi}{T}\frac{1}{4}T\right)+\frac{1}{n^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\frac{1}{4}T\right)\right] - \left[\frac{-\frac{1}{4}T}{n\frac{2\pi}{T}}\sin\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right)+\frac{1}{n^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right)\right]\right] + \frac{4H}{T}\left[\left[\frac{-\frac{2}{T}\left(\frac{3}{4}T\right)+1}{n\frac{2\pi}{T}} \sin\left(n\frac{2\pi}{T}\frac{3}{4}T\right) - \frac{2}{Tn^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\frac{3}{4}T\right)\right] - \left[\frac{-\frac{2}{T}\left(-\frac{1}{4}T\right)+1}{n\frac{2\pi}{T}} \sin\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right) - \frac{2}{Tn^2\frac{4\pi^2}{T^2}}\cos\left(n\frac{2\pi}{T}\left(-\frac{1}{4}T\right)\right)\right]\right]\\ |
|
&= \frac{8H}{T^2}\left[\left[\frac{T^2}{8\pi n}\sin\left(\frac{1}{2}n\pi\right)+\frac{T^2}{n^2 4\pi^2}\cos\left(\frac{1}{2}n\pi\right)\right] - \left[-\frac{T^2}{8\pi n}\sin\left(-\frac{1}{2}n\pi\right)+\frac{T^2}{n^2 4 \pi^2}\cos\left(-\frac{1}{2}n\pi\right)\right]\right] + \frac{4H}{T} \left[\left[-\frac{T}{4\pi n}\sin\left(\frac{3}{2}n\pi\right)-\frac{T}{2\pi^2 n^2}\cos\left(\frac{3}{2}n\pi\right)\right] - \left[\frac{3T}{4\pi n}\sin\left(-\frac{1}{2}n \pi\right)-\frac{T}{2\pi^2 n^2}\cos\left(-\frac{1}{2}n\pi\right)\right]\right]\\ |
|
&= \frac{8H}{T^2}\left[\left[\frac{T^2}{8\pi n}\sin\left(\frac{1}{2}n\pi\right)+\frac{T^2}{n^2 4\pi^2}\cos\left(\frac{1}{2}n\pi\right)\right] - \left[-\frac{T^2}{8\pi n}\sin\left(-\frac{1}{2}n\pi\right)+\frac{T^2}{n^2 4 \pi^2}\cos\left(-\frac{1}{2}n\pi\right)\right]\right] + \frac{4H}{T} \left[\left[-\frac{T}{4\pi n}\sin\left(\frac{3}{2}n\pi\right)-\frac{T}{2\pi^2 n^2}\cos\left(\frac{3}{2}n\pi\right)\right] - \left[\frac{3T}{4\pi n}\sin\left(-\frac{1}{2}n \pi\right)-\frac{T}{2\pi^2 n^2}\cos\left(-\frac{1}{2}n\pi\right)\right]\right]\\ |
|
&= \frac{8H}{T^2}\left[\frac{T^2}{8\pi n}\sin\left(\frac{1}{2}n\pi\right)-\frac{T^2}{8\pi n}\sin\left(-\frac{1}{2}n\pi\right)+\underbrace{\frac{T^2}{n^2 4\pi^2}\cos\left(\frac{1}{2}n\pi\right)-\frac{T^2}{n^2 4\pi^2}\cos\left(-\frac{1}{2}n\pi\right)}_\text{0}\right] + \frac{4H}{T}\left[-\frac{T}{4\pi n}\sin\left(\frac{3}{2}n\pi\right) - \frac{3T}{4\pi n}\sin\left(-\frac{1}{2}n\pi\right) - \underbrace{\frac{T}{2\pi^2 n^2} \cos\left(\frac{3}{2}n\pi\right) + \frac{T}{2\pi^2 n^2} \cos\left(-\frac{1}{2}n\pi\right)}_\text{0}\right]\\ |
|
&= \frac{8H}{T^2}\left[\frac{T^2}{8\pi n}\sin\left(\frac{1}{2}n\pi\right)-\frac{T^2}{8\pi n}\sin\left(-\frac{1}{2}n\pi\right)+\underbrace{\frac{T^2}{n^2 4\pi^2}\cos\left(\frac{1}{2}n\pi\right)-\frac{T^2}{n^2 4\pi^2}\cos\left(-\frac{1}{2}n\pi\right)}_\text{0}\right] + \frac{4H}{T}\left[-\frac{T}{4\pi n}\sin\left(\frac{3}{2}n\pi\right) - \frac{3T}{4\pi n}\sin\left(-\frac{1}{2}n\pi\right) - \underbrace{\frac{T}{2\pi^2 n^2} \cos\left(\frac{3}{2}n\pi\right) + \frac{T}{2\pi^2 n^2} \cos\left(-\frac{1}{2}n\pi\right)}_\text{0}\right]\\ |
Revision as of 23:08, 1 November 2010
Common Synthesizer Waveforms
Many synthesizers employ a variety of waveforms to produce varied sounds. The most common waveform is the sine wave. However, in additive synthesis, multiple waveforms can be added together to create a different waveform with different characteristics. The basis for this form of synthesis is the Fourier series:
The four basic waveforms are Sine Waves, Square Waves, Triangle Waves, and Sawtooth Waves.
Square Wave
By inspection of the waveform, the DC component of the wave will be 0. Also, since the waveform is odd, an will be 0. Here is the proof:
This just leaves the sine component of the waveform found below.
Finally, resulting in the Fourier series for a Square Wave.
Triangle Wave
Like the Square wave, the DC component of the Triangle Wave is 0 by inspection. Also, since the triangle wave is odd, it is made up only by sine components.
Sawtooth Wave
OCTAVE Scripts to Plot Fourier Series
Square Wave
clf; %Clear Figure
t=0:.01:10; %Limits of the graph
T=2*pi %Definition of the period
M=100 %Number of iterations to undergo
sum1=0; %Initialize the sum to
%----------FOURIER SERIES----------%
for m=1:1:M, %For m=1, increment by 1 until you get to M
if(m!=0)
sum1 = sum1 + ((2/(pi*m))-(2/(pi*m))*cos(m*pi))*sin(m*2*pi/T*t);
end
end
%---------------PLOT---------------%
plot(t,real(sum1),'b-')
title('Fourier Series Representation of a Wave')
xlabel('time (seconds)')
ylabel('Function')
grid on;
legend(num2str(M) ' terms');
print("squarewave.png","-dpng") % Prints the plot to a png file called squarewave.png
TODO:
- finish the triangle wave derivation
- start sawtooth wave derivation
- implement triangle wave Fourier Series in OCTAVE
- implement sawtooth wave Fourier Series in OCTAVE