2
$\begingroup$

I am creating an application that works like the Shazam service. In short, my goal is to create an audio pattern matching service. However, I would like to use DWT and not the short time Fourier transform.

I am faced with some problems interpreting the results of the DWT. In particular I have the following questions:

  1. How to plot the results of dwt like a spectrogram?
  2. How to determine what frequency prevails in a given time?
$\endgroup$
1
  • $\begingroup$ Kind of the same question as dsp.stackexchange.com/q/651/29 Also, I think only sinusoidal wavelets like Morlet have a true frequency? $\endgroup$
    – endolith
    Commented Dec 12, 2012 at 17:24

1 Answer 1

2
$\begingroup$

Generally below intensity of the color will tell you about importance of a frequency. Some programming languages have this functionality built in. Let's take for example Mathematica (has free trial). Let's import some sample recording:

voice = ExampleData[{"Sound", "Apollo11ReturnSafely"}]

enter image description here

Here is built in Spectrogram function:

s = voice[[1, 1, 1]]; r = voice[[1, 2]];
Spectrogram[s, SampleRate -> r]

enter image description here

with time on horizontal and frequencies on vertical axes. For wavelets though it is more natural to use Scalogram. Here is built-in function WaveletScalogram:

cwt = ContinuousWaveletTransform[voice, GaborWavelet[6]];
WaveletScalogram[cwt, ColorFunction -> "AvocadoColors", ColorFunctionScaling -> False]

enter image description here

Scalogram can provide useful info. For example it is great for visualizing voice versus noise feature. Voice is more rich and irregular in structure, noise is more monotonic and repetitive. Horizontal axis is time. Vertical axis is octaves. Higher frequencies are resolved at lower octaves and lower frequencies at higher octaves.

For DWT you will have a similar plot:

cwt = DiscreteWaveletTransform[voice];
WaveletScalogram[cwt, ColorFunction -> "AvocadoColors", ColorFunctionScaling -> False]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you. Can you explain me how to plot scalogram in general when I have dwt coefficients only? How to obtain intensities at given time moment(vertical line in plot)? $\endgroup$
    – rayman
    Commented Dec 9, 2012 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.