http://qs1969.pair.com?node_id=1120947

robcatow has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks!

I'm new to this forum and I need your help.

I've been in to perl for quite a while now but I'm especially interested in sound. Now to combine these two things, I want to start a little project, which I would like to introduce to you. And this is what it's about:

A FULL SPECTRUM ANALYZER for recorded sound and existing audio files (but mainly first). If you have no idea what I'm talking about http://en.m.wikipedia.org/wiki/Spectrum_analyzer .. just to get an idea. It's pretty impressive actually. And here is how I'd like to do it:

1 First get a sound input from our microphone. 2 Then analys the recorded data. We are supposedly going to have an array of numbers. A byte array. 3 Now we want this sound in a 'frequency domain' (not a time domain! ) So we need to transform our byte array to a frequency domain 4 and then in the end visualise it.

So this is just a brief overview of what the script is going to be doing. Hopefully! :)

If anyone has got an idea to any of these 4 points I'd be very glad to hear! Sadly perl is very poor concerning sound in general. So all help is very welcome. I'll probably be working on this for quite some time and if you guys are interested I'll be posting my process on the forum!

Cheers Rob C

PG8b5W4ebGA51

Replies are listed 'Best First'.
Re: SPECTRUM ANALYZER in Perl
by karlgoethebier (Abbot) on Mar 23, 2015 at 09:03 UTC

    Audio::Analyzer?

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: SPECTRUM ANALYZER in Perl
by graff (Chancellor) on Mar 24, 2015 at 02:36 UTC
    Because this sort of analysis involves doing a lot of number crunching on arrays and matrices of binary integers and floats, most people opt for compiled code rather than scripting languages to do the heavy lifting.

    Pick a decent compiled signal analysis library (there are at least a few open source projects with good support); it'll probably have command-line tools so that you can easily write perl wrappers for managing processing pipelines, keeping files organized, reporting results, etc.

    You could also try writing perl XS code to link your scripts directly to library functions, but you might find it difficult to do better this way than you would if you were just using compiled command-line tools.