http://www.perlmonks.org?node_id=647101

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

Howdy folks, I have a quick question. I'm a Volunteer Firefighter with a bit of a sleeping problem. Our station gets dispatched on a certain frequency by the use of two tones (510.5hz for 2 seconds, then 2271.7 for 2 seconds) to set off the voice pagers/klaxons/strobes/big 'ol siren. I have my scanner connected to my computer via the microphone-in port (I'm running Ubuntu). What's the easiest way to grab information from the microphone, and determine/analyze the sound in such a way I can tell if my fire company is being dispatched?
The whole reason I'm doing this, is that we now use tiny fancy schmancy digital pagers, which can barely get my attention during the day, much lest bring me back from the dead at night. My room is already partially wired to a few relays/etc/etc, so I'd like to strobe the lights a bit, maybe make some noise. Please help this Audio newbie do some simple decoding.

Replies are listed 'Best First'.
Re: Matching Incoming Audio Tones
by Zaxo (Archbishop) on Oct 25, 2007 at 08:33 UTC

    Are there any signals you wish to ignore?

    PDL::Audio ought to have a way to detect your signals, but the logic of what to respond to isn't clear if some aren't correct. If you must answer all pairs of two-second tones, you don't need to be selective, except for your own information.

    After Compline,
    Zaxo

      Yes, there are several 2-tone-signals, as well as voice transmissions on the frequency. PDL::Audio looks like quite a beast, I'll be spending most of my day laying down a gameplan :-P
Re: Matching Incoming Audio Tones
by KurtSchwind (Chaplain) on Oct 25, 2007 at 13:05 UTC
    I'm not familiar with the module that's been described, but if you want to know what frequency is coming in a mic, you can use a 'fourier transformation'. Scan the docs for Fourier or Fast Fourier Transformation.
Re: Matching Incoming Audio Tones
by ByteFreak (Novice) on Oct 25, 2007 at 21:51 UTC