Kurt's Assignment

From Class Wiki
Revision as of 16:53, 1 November 2010 by Kurt (talk | contribs)
Jump to navigation Jump to search

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:

x(t)=x(t+T)=a0+n=1ancos(nω0t)+bnsin(nω0t)a0=1T0Tf(t)dtan=2T0Tf(t)cos(nω0t)dtbn=2T0Tf(t)sin(nω0t)dt


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:

a0=1T012THdt+1T12TTHdt=1T[Ht]|t=012T1T[Ht]|t=12TT=1TH12T0[1THT1TH12T]=H2[H12H]=H2H2=0


an=2T012THcos(nω0t)dt+2T12TTHcos(nω0t)dt=2T[Hnω0sin(nω0t)]012T+2T[Hnω0sin(nω0t)]12TT=2T[Hn2πTsin(n2πT12T)0]+2T[0+Hn2πTsin(n2piT12T)]=2T[TH2πnsin(nπ)0]+2T[TH2πnsin(nπ)0]=0


This just leaves the sine component of the waveform found below.

bn=2T012THsin(nω0t)dt+2T12TTHsin(nω0t)dt=2T[Hnω0cos(nω0t)]012T+2T[Hnω0cos(nω0t)]12TT=2T[Hn2πTcos(n2πT12T)+Hn2πT]+2T[Hn2πTcos(n2πTT)Hn2πTcos(n2πT12T)]=2T[TH2πncos(nπ)+TH2πn]+2T[TH2πncos(2πn)1TH2πncos(nπ)]=Hπncos(nπ)+Hπn+HπnHπncos(nπ)=2Hπn2Hπncos(nπ)


Finally, resulting in the Fourier series for a Square Wave.

Square Wave Fourier Series: x(t)=x(t+T)=n=1(2Hπn2Hπncos(nπ))sin(nω0t)

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

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