MATH528 Lab10: Sturm-Liouville basketball example

Input sound

This is the ringing sound extracted from classroom measurements of the basketball bounce

m=

These are the properties of the sound sample

props={AudioLength,Duration,AudioChannels,AudioSampleRate,AudioType};

Dataset@AssociationThread[props,Through[props[m]]]

Find the sampling frquency

fs=AudioSampleRate[m]

Transform the sound into data

d=AudioData[m];

Dimensions[d]

ListPlot[d,PlotRange->All]

Spherical harmonics representation of sound

Conformant window

Choose one channel and a window that corresponds to a repeating signal

data=d[[1,17678;;20000]];
ListPlot[data]

nd=Length[data]

Compute the Fourier coefficients

nMax=100; dj=2. π/nd;
a=Table[  1/2./nd Sum[data[[j]] Cos[j n dj],{j,1,nd}],{n,1,nMax}];
b=Table[  1/2./nd Sum[data[[j]] Sin[j n dj],{j,1,nd}],{n,1,nMax}];
c2c=Log10[(a^2)+(b^2)];

Find index of largest coefficient

kmx=Position[c2c,Max[c2c]][[1,1]]

Compute the signal period

T=nd/fs

The dominant frequency is

fmx = N[(((T/kmx))^(-1))]

The (Subscript[E, 2]) note should have a frequency of 82.41 Hz, hence the recorded sound is mistuned by

fE2=82.41; fE2G=83.8428;
err = N[(fE2G-fE2)/fE2]

ConformantWindowSpectrum=ListPlot[c2c,PlotStyle->Blue]