Square wave vs Sine wave signals

Discussion in 'General Electronics Chat' started by sdh314, Nov 25, 2011.

  1. sdh314

    Thread Starter New Member

    Jun 2, 2011
    18
    0
    Hi all,

    I'm building an ambient light rejection circuit which measures the scattered light from a LED pulse which is driven by a 1kHz square wave.

    I don't have a strong signals background, but I was wondering if anyone out there wanted to comment (or could point me to some info) on design considerations when dealing with square wave AC signals over sinusoidal signals.

    I'm planning to read the output signal into a ADC when the LED pulse is high. Unfortunately, with the various filters I've used in my circuit the final output is far from a square wave.

    I was hoping to implement a way to average ADC samples over the duration of the LED pulse (performed by a uprocessor) but given the non-top hat form of the signal I need to think of a different way to do it. I'm probably going to run the output through a precision rectifier to remove any negative voltages (which occur during the OFF state of the LED). Is there any circuit (perhaps a unique kind of rectifier) that can provide a reasonably constant flat signal for the ADC to sample from?

    Any suggestions would be hugely appreciated!

    Thanks in advance,

    Stuart
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    You can try using a precision rectifier circuit which had been discussed here. Follow this with a low pass filter.
     
  3. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    You would probably want to capture samples from both the high and the low part of the signal, so that you can determine the difference between them. In this way, the responses due to your deliberately emitted signal can be separated from those due to ambient light, dark leakage current in the detector, or amplifier offsets.
     
  4. crutschow

    Expert

    Mar 14, 2008
    12,973
    3,219
    You could amplify the signal with a high-frequency DC coupled (op) amp to preserve preserve the zero volt and high value of the square wave. Then you could sample the data at a high rate (say 10 times the 1kHz frequency or 10kHz). You can then average (filter) the signals digitally using the microprocessor.
     
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I would take a slightly different approach. AC couple, amplify and clip the incoming signal from the photosensor. A 1kHz notch pass filter may help too. Any presence of a 1kHz signal can be detected in software by the microcontroller doing period analysis.
     
Loading...