Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find data in a wave file ?

Status
Not open for further replies.

daniloa

Programmer
Nov 23, 2001
27
BR

Hi everyone,

How are you ?

Happy new year for all !!!

Well I want to know how can I find some data like a tone in a recorded wave
file in WindowsPCM format in 11kHz - 8bits.
This file(s) will contain some conversations like phone conversations and
some tones in midlle so I need to find this tones, how can I read this datas
and recognize some tone ?

Very Thanks for helps,

Danilo Almeida.
 
I believe there should be a speech API, or something like this, search more in google or msdn.

Ion Filipski
1c.bmp
 
One way to search for tones in a wave file is to transform sections of it to the frequency domain. This can be done using an FFT (fast fourier transform) function. The output of the FFT is a spectrogram which shows the strengths of each frequency. Then look at the relative power in the frequency band of the tone you're looking for, compared to the other bands. If I've lost you, sorry about that. It takes a little lower-division electrical engineering to get a handle around this problem.

The FFT function usually takes some power of 2 samples of the wave file (e.g. 1024 samples) and transforms them into an equivalent number of frequency bins, dividing the power of the sound into different frequency bands. So you would need to break the wave file up into groups of 1024 samples or whatever the FFT takes, and run the FFT on each group. Then compare the power in the desired bin with other bins, until you find a case where the desired bin far exceeds all other bins. This indicates the tone is present in that window of samples.

Actually some sound file players such as WinAmp come with an FFT-like display built in as one of the default visualizations. If you were to play a sound file consisting of different tones, you would see spikes in the display every time there was a specific frequency tone
playing.

By the way, if by "tone" you mean something more complex than a single frequency (e.g. a guitar tone) it is a lot more difficult because even with an FFT you need to match the frequency spectrum with that of the tone you're looking for. If the tone is more than just one pure frequency, this can be as complex as other pattern matching problems like speech recognition.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top