Shop OBEX P1 Docs P2 Docs Learn Events
Simplest, fastest way to track audio signal? — Parallax Forums

Simplest, fastest way to track audio signal?

T ChapT Chap Posts: 4,223
edited 2010-07-05 21:46 in Propeller 1
Recently I experimented with using a counter to control a voltage to an opto FET that is operating as a shunt on an audio signal path. The idea on that project is to ramp in and out of some audio (mp3's) playing on a vinculum>VS1033. It gave me an idea to experiment with building a compressor for audio signals, where the FET will attenuate the signal based on sending it a voltage from a counter. The question I have is, what is a good way to track the signal, so the program can have a threshold and apply an envelop that has presets set up to manage the output DAC. The idea is to least affect the original audio path, only tap off it to trip a preset threshold. Would using the bare bones Prop ADC method work fine with some assembly code, or would an external DAC be best? 'Best' meaning the least affect on the audio path (load, adding noise etc), plus speed of tracking the audio. I am also thinking that the opto FET is not the best solution, but just get a FET designed for AC, since the LED takes some amount of voltage just to turn on. Any suggestions?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-03 20:12
    Just to clarify, do you want a dynamic range compressor, which alters the audio waveforms, or an automatic gain control (AGC) which just adjusts the volume level?

    -Phil
  • T ChapT Chap Posts: 4,223
    edited 2010-07-03 20:18
    Just gain control (attenuation only). Least amount of electronics in the pathway, so using the FET as a shunt, shooting for a straight wire signal path ideally, but of course a resister in series is required for the shunt to work, which leaves the issue of whether to use an op amp to make back up the gain. However, the signals will always be balanced in the real world, so the idea of a transformer in and out might allow for not having to use a series resister between the transformers, although I can't recall if there is a db loss adding the unbalancing xformer in, then the balancing xformer back out.... which still may require some gain make up on the output.

    Post Edited (Todd Chapman) : 7/3/2010 8:26:30 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-03 20:32
    The best AGCs will incorporate a delay line, so that volume changes can be applied smoothly and retroactively. Otherwise, even with a "fast attack, slow decay" methodology, you will still risk clipping and distortion before a correction can be applied.

    -Phil
  • RinksCustomsRinksCustoms Posts: 531
    edited 2010-07-04 03:52
    i have an idea (related) of being able to give any headphones near perfectly flat frequency response.. Something similar to AGC but based on impedance tracking.. Employment however would be another can of worms i think.. for one thing - the paradox of a signal that is meant to vary in strength & frequency and its attenuation in compensation for an inductor in a constantly varying magnetic flux where the voice coil inductor changes resistance slightly based on excursion and frequency of the audio program. This technology could proove usefull in loudspeaker systems as well..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • T ChapT Chap Posts: 4,223
    edited 2010-07-04 20:13
    Rephrasing the question:

    Does anyone have a suggestion to watch an audio input that may range from 0 to several volts AC? I don't care about what is below 0 (negative). I just want to see what is above 0, and set a threshold to trigger a method that runs an envelop with a counter on each trip point exceeded. The thing is how to attach a line to an audio signal without affecting it, then rectify it if needed to see the positive. Can the basic Prop ADC do something like this? I will have time to test it in a few days. I2C seems like it would be a bit slow to catch a transient, but would be fine on a vocal probably.

    MIC to VGA is interesting

    Post Edited (Todd Chapman) : 7/4/2010 8:41:10 PM GMT
  • T ChapT Chap Posts: 4,223
    edited 2010-07-05 21:46
    After looking at all the available info, in the counter app note they discuss reading an AC signal, which required changing the resistor to a .1 cap, I have what I think is going to work. It seems the basic ADC.spin will allow access to the DAC value, then do what you want with it. At least it is a simple way to start learning how to do what I want to do. With an AC signal and using a cap for the input, with no audio the values are midway between the maximum value for that particular bit rate, so it is easy to get both the positive and negative going values.
Sign In or Register to comment.