dave.harper wrote:
I'm trying to come up with a filter or converter that takes a square
wave input and outputs something closer to a sign wave (varying
between ~1.9kHz and 2.1kHz). It can have some distortion, but I'm
trying to eliminate the sharp leading and trailing edge. One option
I'm pursuing is a bandpass filter (2 caps and 2 resistors), which
looks to give a reasonable output, but still not quite as smooth as
I'd like. I've also considered using a counter feeding a bank of
resistors, but finding a method for it to start counting up with it
hits 0 and down when it hits the high value might be more difficult.
Originally, I had used a wein-bridge oscillator with op-amps to make
the sine wave, but due to the environment, EMI was a problem and it
damped out the oscillations (even with ferrite beads and modest
shielding). So I'd like to avoid using op-amps (since they are
apparently sensitive to EMI) if possible.
Any suggestions?
Use a 4017 counter, plus resistors.
Or, there are some nice 5-pole analog filters out there. Not cheap, but
they'll do ya.
You could implement an up/down counter in a PAL. Doing it so that it
up/down counts properly shouldn't be too hard.
Or use one of the myriad itty bitty processors out there -- PIC, AVR,
whatever.
--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com