Comparing audio files

Discussion in 'Perl Misc' started by kieran, Oct 8, 2008.

  1. kieran

    kieran Guest

    Hello,
    I am trying to compare two similar audio files (WAV). From what i have
    read i need to sample both audio files at certain frequencies and run
    these through a FFT and then compare the results. Can anyone advise me
    if this is the correct approach and also describe the steps i need to
    take to get to the stage where I can compare the files.
    TIA,
    Kieran
    kieran, Oct 8, 2008
    #1
    1. Advertising

  2. kieran <> wrote:

    >I am trying to compare two similar audio files (WAV). From what i have
    >read i need to sample both audio files at certain frequencies and run
    >these through a FFT and then compare the results. Can anyone advise me
    >if this is the correct approach and also describe the steps i need to
    >take to get to the stage where I can compare the files.


    You could try the ESP::pSI module.

    jue
    Jürgen Exner, Oct 8, 2008
    #2
    1. Advertising

  3. kieran

    kieran Guest

    On Oct 8, 5:12 pm, Jürgen Exner <> wrote:
    > kieran <> wrote:
    > >I am trying tocompare twosimilar audio files (WAV). From what i have
    > >read i need to sample both audio files at certain frequencies and run
    > >these through a FFT and then compare the results. Can anyone advise me
    > >if this is the correct approach and also describe the steps i need to
    > >take to get to the stage where I can compare the files.

    >
    > You could try the ESP::pSI module.
    >
    > jue


    Hi Jue,
    thanks for your reply, i have searched for the module you mentiones in
    CPAN and Google but could not find it.
    Can you please send me a link.
    Best Regards,
    Kieran
    kieran, Oct 15, 2008
    #3
  4. kieran

    greymaus Guest

    On 2008-10-15, kieran <> wrote:
    > On Oct 8, 5:12 pm, Jürgen Exner <> wrote:
    >> kieran <> wrote:
    >> >I am trying tocompare twosimilar audio files (WAV). From what i have
    >> >read i need to sample both audio files at certain frequencies and run
    >> >these through a FFT and then compare the results. Can anyone advise me
    >> >if this is the correct approach and also describe the steps i need to
    >> >take to get to the stage where I can compare the files.

    >>
    >> You could try the ESP::pSI module.
    >>
    >> jue

    >
    > Hi Jue,
    > thanks for your reply, i have searched for the module you mentiones in
    > CPAN and Google but could not find it.
    > Can you please send me a link.
    > Best Regards,
    > Kieran


    The reply may, just may, be his attempt at humour. You can try the NSA!.

    --
    Greymaus
    greymaus, Oct 15, 2008
    #4
  5. greymaus wrote:
    > On 2008-10-15, kieran <> wrote:
    >> On Oct 8, 5:12 pm, Jürgen Exner <> wrote:
    >>> kieran <> wrote:
    >>>> I am trying tocompare twosimilar audio files (WAV). From what i have
    >>>> read i need to sample both audio files at certain frequencies and run
    >>>> these through a FFT and then compare the results. Can anyone advise me
    >>>> if this is the correct approach and also describe the steps i need to
    >>>> take to get to the stage where I can compare the files.
    >>> You could try the ESP::pSI module.
    >>>
    >>> jue

    >> Hi Jue,
    >> thanks for your reply, i have searched for the module you mentiones in
    >> CPAN and Google but could not find it.
    >> Can you please send me a link.
    >> Best Regards,
    >> Kieran

    >
    > The reply may, just may, be his attempt at humour. You can try the NSA!.
    >


    Surely there's an Acme::ESP and Acme::pSI in CPAN?

    --
    RGB

    * ***
    *** *
    *
    RedGrittyBrick, Oct 15, 2008
    #5
  6. kieran

    Ted Zlatanov Guest

    Ted Zlatanov, Oct 15, 2008
    #6
  7. RedGrittyBrick, Oct 15, 2008
    #7
  8. kieran

    kieran Guest

    On Oct 16, 9:56 pm, rc <> wrote:
    > On Oct 8, 4:39 pm, kieran <> wrote:
    >
    > > Hello,
    > > I am trying to compare two similar audio files (WAV). From what i have
    > > read i need tosampleboth audio files at certain frequencies and run
    > > these through a FFT and then compare the results. Can anyone advise me
    > > if this is the correct approach and also describe the steps i need to
    > > take to get to the stage where I can compare the files.

    >
    > While this can certainly be done in Perl, a nice environment for
    > prototyping this kind of applications is GNU Octave or Matlab (given
    > you are rich or a student). Reading some files from wav,down/
    > upsampling them, applying filters and perform an fft is just a few
    > lines of code in both of these tools.
    >
    > Once you have a working solution, you can still collect all modules
    > you need to do it in Perl from CPAN or just continue to use Octave via
    > Inline::Octave.
    >
    > Now for what to do exactly, this heavily depends on what your input
    > and your goals are. To get help with this, maybe asking in a group
    > about audio processing or algorithms would be better.
    >
    > Good luck
    >
    > Christian
    >
    > --
    > rc at networkz dot ch


    Hi Christian,
    Thanks for your reply, the approach you describe will certainly help,
    I have requested a trial version of Octave so I will begin using that
    for protoyyping once I get access.

    A couple of things you might be able to help me with, I have been
    looking for some modules to use for downsampling, filtering etc... The
    module I found for resampling audio called Audio::Mad::Resample would
    not install on my machine, i got some errors that i could not resolve.
    Are there any modules you can recomend for down/up sampling?
    Also for creating a low-pass filter i have been looking at PDL::Audio,
    there are many types of filter available in this module, I am not sure
    which is best for low-pass filters.
    Thanks,
    Kieran
    kieran, Oct 22, 2008
    #8
  9. kieran

    kieran Guest

    On Oct 22, 3:58 pm, kieran <> wrote:
    > On Oct 16, 9:56 pm, rc <> wrote:
    >
    >
    >
    > > On Oct 8, 4:39 pm, kieran <> wrote:

    >
    > > > Hello,
    > > > I am trying to compare two similar audio files (WAV). From what i have
    > > > read i need tosampleboth audio files at certain frequencies and run
    > > > these through a FFT and then compare the results. Can anyone advise me
    > > > if this is the correct approach and also describe the steps i need to
    > > > take to get to the stage where I can compare the files.

    >
    > > While this can certainly be done in Perl, a nice environment for
    > > prototyping this kind of applications is GNU Octave or Matlab (given
    > > you are rich or a student). Reading some files from wav,down/
    > > upsampling them, applying filters and perform an fft is just a few
    > > lines of code in both of these tools.

    >
    > > Once you have a working solution, you can still collect all modules
    > > you need to do it in Perl from CPAN or just continue to use Octave via
    > > Inline::Octave.

    >
    > > Now for what to do exactly, this heavily depends on what your input
    > > and your goals are. To get help with this, maybe asking in a group
    > > about audio processing or algorithms would be better.

    >
    > > Good luck

    >
    > > Christian

    >
    > > --
    > > rc at networkz dot ch

    >
    > Hi Christian,
    > Thanks for your reply, the approach you describe will certainly help,
    > I have requested a trial version of Octave so I will begin using that
    > for protoyyping once I get access.
    >
    > A couple of things you might be able to help me with, I have been
    > looking for some modules to use for downsampling, filtering etc... The
    > module I found for resampling audio called Audio::Mad::Resample would
    > not install on my machine, i got some errors that i could not resolve.
    > Are there any modules you can recomend for down/up sampling?
    > Also for creating a low-pass filter i have been looking at PDL::Audio,
    > there are many types of filter available in this module, I am not sure
    > which is best for low-pass filters.
    > Thanks,
    > Kieran


    Hello,
    I have done some of the work in prototyping the wav file comparison in
    MATLAB and I have begun translating this into perl. I am experiencing
    some problems when I read the data from the wave file in perl, the
    values I am getting seem very large and seem to be 3,000(aprox.) times
    larger than the values i get when i imported the wav file data into
    Matlab. When I graph both sets of values the resulting graphs look the
    same as the wave form.
    In matlab i am using the wavread function to read the samples from my
    wav file. I get 49617 samples of very low numbers, lots of zero values
    and plenty of very low and negative values. I have followed a few
    tutorials in Matlab and these reading look correct.
    However when i attempt to do the same in perl i get the smae ammount
    of samples but the numbers are very large and with few if any zero
    readings. I have been uing the Audio::Analyzer Audio::Wav::Read
    modules.
    Can you explain why I am getting such a large difference between
    Matlab nad perl? I would expect the results to match.
    If you require any more information please let me know.
    Regards,
    Kieran
    kieran, Nov 11, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aten
    Replies:
    1
    Views:
    647
    Roedy Green
    Oct 4, 2003
  2. aten
    Replies:
    4
    Views:
    1,338
    Kevin Goodsell
    Oct 4, 2003
  3. kj7ny
    Replies:
    2
    Views:
    291
    Yu-Xi Lim
    Dec 29, 2006
  4. aeonsun
    Replies:
    2
    Views:
    417
    Luc The Perverse
    Mar 11, 2007
  5. sick dick
    Replies:
    0
    Views:
    383
    sick dick
    Apr 3, 2006
Loading...

Share This Page