Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Detecting audio

  1. #1
    Junior Member
    Join Date
    Dec 2018

    Detecting audio

    Hi All,

    I wonder if anyone could tell me if the Teensy 3.2 is capable of detecting an audio signal. This is the output from a VHF radio. It is 2v peak-to-peak.

    I just need to sense whether there is sound present or not. This is to detect if a transmission is coming through on a radio. It is just a single mono wire that is line level.

    Could this wire just be spliced in to an analogue port on the teensy and if the analogue value reads above a certain value then it indicates that audio is present.

    I am not sure if any other components would be required.

    Many thanks in advance.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Yes, Teensy 3.2 can do this. In fact, there are many ways it could do this.

    You definitely will need some other parts to interface the signal to Teensy 3.2. This link to the audio library ADC input has a recommended schematic for a 1 Vp-p signal (look on the right-side documentation panel).

    If you use a couple resistors to attenuate the signal to half that amplitude, you could use this circuit.

    You could also use the audio shield, rather than the ADC pin, but the shield is probably overkill if you're just looking to detect a tone.

    Once you get the signal into Teensy 3.2, using the audio library you have several ways to analyze the signal. On the left side panel, scroll down to the "analyze" section to see those. Probably the "tone" analysis would work if you want to detect only that approx frequency. Or use "rms" just to read the signal level.

    If you're not familiar with the audio library, here's a 31 page tutorial. Section 3 of the tutorial, starting on page 22, is probably the most interesting part for your needs.

  3. #3
    Junior Member
    Join Date
    Dec 2018
    Thanks Paul for the very quick reply and the fantastic information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts