Shop OBEX P1 Docs P2 Docs Learn Events
Microphone to Headphone Example — Parallax Forums

Microphone to Headphone Example

stephenwagnerstephenwagner Posts: 147
edited 2010-01-13 02:14 in Propeller 1
I am having a hard time understanding the Microphone to Headphone example.
I always thought that·there was a direct relationship between the amplitude of Vin and·the duty cycle output of a sigma delta modulator ADC and a direct relationship between the change of Vin and duty cycle output of a delta modulator ADC.
So, why can't the results bit of the sigma delta modulator be directly output to an RC lowpass filter?? Or am I missing something here??
I am very much interested in one bit audio delay.

Stephen Wagner
·

Comments

  • TonyWaiteTonyWaite Posts: 219
    edited 2010-01-08 14:15
    I think that the one-bit method relies on sophisticated digital post-processing to get the noise
    out of the signal; it's only the massive oversampling then masive filtering that makes the technique
    work.
    The analogue domain becomes easier, but the digital more difficult ...

    T o n y
  • ErNaErNa Posts: 1,752
    edited 2010-01-08 15:14
    See the ADC as a charge balancer. There is a capacitor and as long as the voltage of the capacitor doesn't change, no electrons flow in or out. To the capacitor are connected two resistors and if current over time (charge) crossing one resistor is equal to current over time of the second, then no charge enters the cap.
    The sensing input detects minimal deviations of the caps voltage to a reference level and connects the compensating resistor to ground or vcc with clock rate, so balancing the charge transfer through the resistors. The voltage on the input resistor is equivalent to the number of pulses of ground level. If the reverence level were Vcc/2, than a ground level input would need a Vcc level compensation voltage, so no ground level compensation impulses would be counted: the voltage on the input is zero. If the voltage on the input is Vcc/, so only ground level compensation pulses exist, the number of pulses equals the number of clock over sampling time. If the sampling time is constant, the number of pulses represents the input voltage. But the result is a digital number and such a digital number needs an DAC to be a analog voltage again. This DAC can be a PWM-generator and a low pass filter.
    But: what is a one bit audio delay?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
    Hello Rest Of The World
    Hello Debris
    Install a propeller and blow them away wink.gif
  • stephenwagnerstephenwagner Posts: 147
    edited 2010-01-08 17:11
    One bit audio delay.

    The output of the sigma delta modulator is stepped through a shift register prior to output to DAC. With the output stepped through 256 shift registers at a rate of 1.8 MHz, a delay of 140 uSec. can realized. 140 uSec. delay can create some interesting audio effects.

    I understand the ADC portion of the microphone example. I need to study and understand the DAC portion of the microphone example.

    SJW
  • VIRANDVIRAND Posts: 656
    edited 2010-01-09 06:37
    "The output of the sigma delta modulator is stepped through a shift register prior to output to DAC. With the output stepped through 256 shift registers at a rate of 1.8 MHz, a delay of 140 uSec. can realized. 140 uSec. delay can create some interesting audio effects.

    Interesting audio effects sounds interesting. Can you describe it? I don't recall any interesting short delay sounds.
    My guess is that it tricks the sense of location provided by earlobes, because the sound is only delayed by an inch or 3cm.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    VIRAND, If you spent as much time SPINNING as you do Trolling the Forums,
    you'd have tons of awesome code to post!
  • stephenwagnerstephenwagner Posts: 147
    edited 2010-01-12 17:35
    OK, I need a good technical description of how this type of Sigma Delta Modulator ADC works. I am missing something.
    ·
    My understanding of Sigma Delta Modulator is that it is a one bit ADC that produces a PWM signal with respect to the input voltage who’s rising and falling edges are with respect to the clock. At VDD/2 the output would be 50% duty at 1/2 the clock speed. At VDD/.75 the duty would be 75% high· at an unknown frequency and at VDD/.25 the duty would be 25% at an unknown frequency. I should be able to take the output of the fbpin, pass it through a low pass filter/buffer which would produce a wave form the is 180 deg. out of phase with the input. The fbpin state is at the opposite polarity of the threshold state·of the adcpin.
    ·
    The 140 uSec delay is from an old BBD delay stereo image expander. Radio Electronics, mid 1980's. If you place your speakers 6 to 8 feet apart, stand away from them by 8 to 10 feet, close your eyes and listen to Pink Floyd Time, all the clocks will appear to be placed on a board in front of you that is 12 feet wide. You can point to each clock and count them. Spatial purity is enhanced and or corrected.

    SJW
  • VIRANDVIRAND Posts: 656
    edited 2010-01-13 02:14
    Thanks for the description of the project.

    The sigma-delta is a little mysterious to me. You described simple PWM.
    To do that, output a triangular or sawtooth wave at the sampling rate.
    It will work if you output triangle wave as PWM as long as you lowpass or RC filter it, it turns back into triangle wave.
    Add the line level or volume controlled headphone audio to that signal through resistors, 330 ohm sounds good.
    Protect the input with diodes so it doesn't go outside 0-3.3V and sting the Propeller.
    Measure the duty cycle anyway you can with the Propeller. (Analog on the input pin always becomes PWM as 0s and 1s).
    If it isn't exactly 50% at quiet then a 10K to 100K pot between 0V/input/3.3V should adjust that.
    Feed the measurements (samples) into a buffer while outputting the previous values of the buffer as PWM into
    another lowpass or ResistorCapacitor filter.
    You might as well duplicate this process without the delay for the other channel, so the outputs are same quality.

    I haven't written the spin for this yet because I'm a bit slow, but someone is going to have a quick Propeller trick I'm sure.
    If not, I have code that is close enough that I might be able to change and post as soon as I can.
    (It uses a 1-bit delay to change voice pitch and echo from the demoboard mic but is not ready to post for that use,
    and it is very noisy at this moment. It also doesn't have an external audio source input yet,
    so my idea of how to input with PWM on the Propeller is untested. )

    Post Edited (VIRAND) : 1/13/2010 2:38:32 AM GMT
Sign In or Register to comment.