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

(jcwren) Re: How to compare 2 wav files.

by jcwren (Prior)
on May 27, 2002 at 20:52 UTC ( #169642=note: print w/ replies, xml ) Need Help??


in reply to How to compare 2 wav files.

This is a non-trivial task, although not impossible.

Basically, you'd need to run a sliding window FFT/DFT (Fast Fourier Transform/Discrete Fourier Transform) and look at the spectral energy density of various frequency groups. If the energy density is the same for both samples at the same time, you could consider them the same.

FFT/DFTs are not difficult to implement, and while I'd tend to do it in C, I think Perl should do it pretty well. There are dozens of FFT/DFT implementations on the 'net. Decoding the .WAV format is pretty simple, also.

About the only problem I can really see is that if you have two .WAV files sampled at different rates (i.e., one is 44.1Khz, and the other 10Khz). In that case, you'd have to resample one to match the other. Still not overly difficult, but an added step.

Welcome to DSP-101

--Chris

e-mail jcwren


Comment on (jcwren) Re: How to compare 2 wav files.
Re^2: How to compare 2 wav files.
by mahfuzt786 (Initiate) on Sep 06, 2012 at 17:21 UTC
    when and where to use FFT..??

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://169642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-08-02 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls