# Programming Wavelets for Audio Identification

How exactly is a wavelet used digitally?

For example, a wavelet could be created to have a frequency of Middle C and a short duration of roughly a 32nd note. If this wavelet was to be convolved with a signal created from the recording of a song, then the resulting signal would be useful for determining when the Middle C note was being played in the song.

Would this be a data structure holding e.g {sampleNumber, frequency} pairs?

If a wavelet is an array of these pairs, how is it applied to the audio data?

How does this wavelet apply to the analysis when using an FFT?

What is actually being compared to identify the signal?

• What do you mean by how exactly is Wavelet used digitally? Which particular Wikipedia article are you talking about? FFT and Wavelet are entirely two different beasts. Do you understand what does Wavelet Transform yield? – user1343318 Jun 17 '13 at 4:33
• Wikipedia's just calling any kind of short-duration waveform a "wavelet". It's not the more restricted mathematical/signal processing definition of wavelets, which are used at different scales and have specific properties. The example given in Wikipedia is more an example of matched filtering than of wavelet analysis. I don't think most wavelets even have a "frequency", only the Morlet wavelet. – endolith Jun 18 '13 at 19:06

Convolution can be used to find the note. Its best shown visually .

Would this be a data structure holding e.g {sampleNumber, frequency} pairs?

Yes, the signal would be. The wavelet can be stored as a function but it can also be {sampleNumber, frequency} pairs.

If a wavelet is an array of these pairs, how is it applied to the audio data?

Convolution:

$f*g = \int f(x)g(t-x)dx$

Convolution is commutative so it does not matter whether f or g is wavelet or signal or vice versa.

How does this wavelet apply to the analysis when using an FFT?

In some applications in signal processing, convolution is calculated using the convolution theorem.

$\mathcal{F}(f*g) = \mathcal{F}(f) \mathcal{F}(g)$

so the convolution of f and g can alternatively be calculated by

$f*g = \mathcal F ^{-1}[ \mathcal{F}(f) \mathcal{F}(g)]$

What is actually being compared to identify the signal?

The signal is being compared to the wavelet

How exactly is a wavelet used digitally?

There are many applications, besides note identification, they can be used in lossy signal compression. See the Dirac codec.

Cross Correlation is a similar operation which can be used for identifying wavelets