Shop OBEX P1 Docs P2 Docs Learn Events
Audio line-in value on the Prop BackPack — Parallax Forums

Audio line-in value on the Prop BackPack

TRSdevTRSdev Posts: 2
edited 2011-01-12 10:40 in Propeller 1
Hello,
I am trying to evalulate the audio line-in on the backpack, but not sure how to go about it.
I have read Phil's post about using the bell202modem object:
http://forums.parallax.com/showthread.php?123480-Can-I-get-me-some-of-that-sweet-Line-in-Audio-(ala-the-Propeller-Backpack)&highlight=backpack
But I don't need to demodulate the signal, I think, I just want a amplitude value or whatever else I could glean from regular voice audio.
..confused as usual..
I am so not an expert, I just want to make a sound display like thing.
Seemed like a fun thing to try.

Thanks for any help!

-Joe

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-11 21:44
    The audio input is line-level. What that implies is that a microphone will require preamplification to register. But 1V P-P should be more than enough amplitude. The actual digital amplitude value that you read in your program will depend on the sigma-delta sample time. Frequency response will be inversely proportional to sample time, so there is a trade-off.

    -Phil
  • TRSdevTRSdev Posts: 2
    edited 2011-01-12 08:43
    Thanks Phil,
    Will using the recieve method in your bel202modem object work for my situation since my input is voice audio? (I am using line-level in BTW)
    If not what do you suggest to read the audio coming in?

    thx
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-12 10:40
    That receive method should work. Once the pins and sigma-delta ADC have been set up, these four lines will get the ADC sample for you:
    pollinp       waitcnt   time,delay              'Wait for the 1/(1200 * 16) second interval.
                  mov       adc,phsb                'Read the accumulated signal amplitude.
                  sub       adc,padc                'Subtract the previous value.
                  add       padc,adc                'Add the difference back to prev (i.e. prev := new).
    

    If you need to zero-reference the AC signal, you may also want to keep a running average of adc so you can subtract it from the instantaneous value.

    -Phil
Sign In or Register to comment.