# Spectral Analysis  Fourier Decomposition Adding together different sine waves P

## Spectral Analysis  Fourier Decomposition Adding together different sine waves P

Templer, Karen, Founder; Editor in Chief has reference to this Academic Journal, PHwiki organized this Journal Spectral Analysis  Fourier Decomposition Adding together different sine waves PHY103 image from https://www.wikipedia.org/ f Spectral decomposition Fourier decomposition Previous lectures we focused on a single sine wave. With an amplitude in addition to a frequency Basic spectral unit – How do we take a complex signal in addition to describe its frequency mix We can take any function of time in addition to describe it as a sum of sine waves each with different amplitudes in addition to frequencies Sine waves  one amplitude/ one frequency Sounds as a series of pressure or motion variations in air. Sounds as a sum of different amplitude signals each with a different frequency. Wave as long as m vs Spectral view in Audition

This Particular University is Related to this Particular Journal

Clarinet spectrum Clarinet spectrum with only the lowest harmonic remaining Time Frequency Spectral view Wave as long as m view Full sound Only lowest harmonic Four complex tones in which all partials have been removed by filtering (Butler Example 2.5) One is a French horn, one is a violin, one is a pure sine, one is a piano (but out of order) Its hard to identify the instruments. However clues remain (attack, vibrato, decay)

Making a triangle wave with a sum of harmonics. Adding in higher frequencies makes the triangle tips sharper in addition to sharper. From Berg in addition to Stork Sum of waves Complex wave as long as ms can be reproduced with a sum of different amplitude sine waves Any wave as long as m can be turned into a sum of different amplitude sine waves Fourier decomposition – Fourier series What does a triangle wave sound like compared to the square wave in addition to pure sine wave (Done in lab in addition to previously in class) Function generators often carry sine, triangle in addition to square waves ( in addition to often sawtooths too) If we keep the frequency the same the pitch of these three sounds is the same. However they sound different. Timbre — that character of the note that enables us to identify different instruments from their sound. Timbre is related to the frequency spectrum.

Square wave Same harmonics however the higher order harmonics are stronger. Square wave sounds shriller than the triangle which sounds shriller than the sine wave From Berg in addition to Stork Which frequencies are added together To get a triangle or square wave we only add sine waves that fit exactly in one period. They cross zero at the beginning in addition to end of the interval. These are harmonics. f frequency 5f 3f Periodic Waves Both the triangle in addition to square wave cross zero at the beginning in addition to end of the interval. We can repeat the signal Is Periodic Periodic waves can be decomposed into a sum of harmonics or sine waves with frequencies that are multiples of the biggest one that fits in the interval.

Sum of harmonics Also known as the Fourier series Is a sum of sine in addition to cosine waves which have frequencies f, 2f, 3f, 4f, 5f, . Any periodic wave can be decomposed in a Fourier series Building a sawtooth by waves Cookdemo7 a. top down b. bottom up Light spectrum Image from http://scv.bu.edu/~aarondf/avgal.html

Sound spectrum Sharp bends imply high frequencies Leaving out the high frequency components smoothes the curves Low pass filter removes high frequencies  Makes the sound less shrill or bright Sampling If sampled every period then the entire wave is lost The shorter the sampling spacing, the better the wave is measured — more high frequency in as long as mation

More on sampling Two sample rates A. Low sample rate that distorts the original sound wave. B. High sample rate that perfectly reproduces the original sound wave. Image from Adobe Audition Help. Guideline as long as sampling rate Turning a sound wave into digital data: you must measure the voltage (pressure) as a function of time. But at what times Sampling rate (in seconds) should be a few times faster than the period (in seconds) of the fastest frequency you would like to be able to measure To capture the sharp bends in the signal you need short sampling spacing What is the relation between frequency in addition to period Guideline as long as choosing a digital sampling rate Sampling rate should be a few times shorter than 1/(maximum frequency) you would like to measure For example. If you want to measure up to 10k Hz. The period of this is 1/104 seconds or 0.1ms. You would want to sample at a rate a few times less than this or at ~0.02ms. Period is 1/frequency

Recording in Audition The most common sample rates as long as digital audio editing are as follows: 11,025 Hz Poor AM Radio Quality/Speech (low-end multimedia) 22,050 Hz Near FM Radio Quality (high-end multimedia) 32,000 Hz Better than FM Radio Quality (st in addition to ard broadcast rate) 44,100 Hz CD Quality 48,000 Hz DAT Quality 96,000 Hz DVD Quality Demo degrading sampling in addition to resolution Clip of song by Lynda Williams sampling is 48kHz resolution 16 bit 48kHz sampling , 8 bit 11kHz sampling, 16bit Bits of measurement 8 bit binary number 00000000b = 0d 00000001b = 1d 00000010b = 2d 00000011b = 3d 00000100b = 4d 11111111b = 511d can describe 2^8 = 512 different levels

Bit of precision Error in amplitude of signal loudness error error in recording the strength of signal sampling Bits of measurement A signal that goes between 0Volt in addition to 1Volt 8 bits of in as long as mation You can measure 1V/512 = 0.002V = 2mV accuracy 16bits of in as long as mation 2^16 = 65536 1V/65536= 0.000015V = 0.015mV = 15micro Volt accuracy Creating a triangle wave with Matlab using a Fourier series dt = 0.0001; % sampling time = 0:dt:0.01; % from 0 to 0.01 seconds total with sampling interval dt % Here my sample interval is 0.0001sec or a frequency of 10^4Hz frequency1 = 440.0; % This should be the note A % harmonics of this odd ones only frequency2 = frequency13.0; frequency3 = frequency15.0; frequency4 = frequency17.0; % here are some amplitudes a1 = 1.0; a2 = 1.0/9.0; a3 = 1.0/25.0; a4 = 1.0/49.0; % here are some sine waves y1 = sin(2.0pifrequency1time); y2 = sin(2.0pifrequency2time); y3 = sin(2.0pifrequency3time); y4 = sin(2.0pifrequency4time); % now let’s add some together y = a1y1 – a2y2 + a3y3 – a4y4; plot(time, y); % plot it out

Playing the sound %Modify the file so the second line has time = 0:dt:2; %(2 seconds) %Last line: play it: sound(y, 1/dt) Save it as a .wav file as long as later wavwrite(0.8y,1/dt,’triangle.wav’) Phase Up to this point we have only discussed amplitude in addition to frequency x = 0:pi/100:2pi; y = sin(x); y2 = sin(x-.25); y3 = sin(x-.5); plot(x,y,x,y2,x,y3) Sine wave period amplitude phase