Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Fast Fourier Transform is a good option but you might also consider Hidden Markov Models (HMMs). These statistical models are commonly used for speech recognition tasks and have the advantage over FFT that they are less likely to be fooled by an off-target sample point. HMMs build a probabalistic model of a pattern (in this case a sound wave) and will provide you will a likelihood that the sound wave it is given matches the training set.

To apply the idea to your problem, you use the first wave file as a training set and the second as test set. If the HMM returns a probablility for the test set of greater than say, 0.9 consider them equal. This probabilistic approach will serve you well in this case. For example, with FFT to identical wave files recorded at different frequency may not be matched, whereas an HMM should be able to encapsulate this difference.

Here are some links to get you started. However, be aware that what you are attempting is non-trivial as jcwren points out and also many people devote their entire degrees/Phds to this area... would it be better if you just used a human? There are times when a computer isn't the best solution, and knowing when to recognise this can be key to many Artifical Intelligence tasks...

HMM Tutorial

HMMs for Speech

Hope this helps, or at least touches the tip of the ice-berg.

____________
Arun

In reply to Re: How to compare 2 wav files. by arunhorne
in thread How to compare 2 wav files. by shadox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found