Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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? Thanks in advance! Dave |
#2
![]() |
|||
|
|||
![]()
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 |
#3
![]() |
|||
|
|||
![]()
On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John |
#4
![]() |
|||
|
|||
![]()
On Mar 23, 3:00*pm, John Larkin
wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. I have 3 RC low-pass filters and the output looks relatively sine-like. Thanks to everyone that provided good suggestions! Here's the schematic in LTSpice (comments appreciated): Version 4 SHEET 1 1476 680 WIRE 592 -608 0 -608 WIRE -80 -528 -160 -528 WIRE -80 -496 -80 -528 WIRE -160 -464 -160 -528 WIRE 464 -368 32 -368 WIRE 144 -304 80 -304 WIRE 80 -256 80 -304 WIRE 144 -240 144 -304 WIRE 160 -240 144 -240 WIRE 416 -240 416 -256 WIRE 416 -240 384 -240 WIRE -160 -176 -160 -400 WIRE 0 -176 0 -608 WIRE 0 -176 -160 -176 WIRE 160 -176 0 -176 WIRE 464 -176 464 -368 WIRE 464 -176 384 -176 WIRE -592 -144 -592 -192 WIRE -544 -144 -592 -144 WIRE -432 -144 -464 -144 WIRE -352 -144 -352 -192 WIRE -352 -144 -432 -144 WIRE -352 -112 -352 -144 WIRE 160 -112 96 -112 WIRE 592 -112 592 -608 WIRE 592 -112 384 -112 WIRE -592 -96 -592 -144 WIRE -432 -96 -432 -144 WIRE 32 -96 32 -368 WIRE 32 -96 -160 -96 WIRE 160 -48 144 -48 WIRE 448 -48 384 -48 WIRE -592 16 -592 -16 WIRE -432 16 -432 -16 WIRE -352 16 -352 -48 WIRE 448 16 448 -48 WIRE -160 32 -160 -16 WIRE 144 32 144 -48 WIRE 144 32 -160 32 WIRE 144 80 144 32 WIRE 208 80 144 80 WIRE 448 128 448 80 WIRE 96 160 96 -112 WIRE 96 240 -64 240 WIRE -64 256 -64 240 WIRE 96 288 96 240 WIRE -64 336 -224 336 WIRE -224 352 -224 336 WIRE -64 384 -64 336 WIRE -224 432 -384 432 WIRE -224 480 -224 432 FLAG -592 16 0 FLAG 80 -256 0 FLAG -592 -192 +5V FLAG 416 -256 +5V FLAG -352 16 0 FLAG -432 16 0 FLAG -352 -192 +2.5V FLAG 448 128 0 FLAG -80 -496 0 FLAG 208 80 +5V FLAG -64 448 0 FLAG 96 352 0 FLAG -224 544 0 SYMBOL voltage -592 -112 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 0 -66 54 Left 0 WINDOW 3 47 51 Left 0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL res -560 -128 R270 WINDOW 0 32 56 VTop 0 WINDOW 3 0 56 VBottom 0 SYMATTR InstName R6 SYMATTR Value 1k SYMBOL res -448 -112 R0 SYMATTR InstName R7 SYMATTR Value 1k SYMBOL polcap -368 -112 R0 SYMATTR InstName C3 SYMATTR Value 10µ SYMBOL Misc\\NE555 272 -144 R0 SYMATTR InstName U1 SYMBOL cap 432 16 R0 SYMATTR InstName C1 SYMATTR Value 10nF SYMBOL res -176 -192 R0 SYMATTR InstName R2 SYMATTR Value 33500 SYMBOL res -176 -112 R0 SYMATTR InstName R1 SYMATTR Value 1000 SYMBOL cap -176 -464 R0 SYMATTR InstName C2 SYMATTR Value .01µF SYMBOL cap -80 384 R0 SYMATTR InstName C4 SYMATTR Value .08µF SYMBOL res -80 240 R0 SYMATTR InstName R3 SYMATTR Value 1000 SYMBOL cap 80 288 R0 SYMATTR InstName C10 SYMATTR Value .08µF SYMBOL res 80 144 R0 SYMATTR InstName R8 SYMATTR Value 1000 SYMBOL cap -240 480 R0 SYMATTR InstName C11 SYMATTR Value .08µF SYMBOL res -240 336 R0 SYMATTR InstName R12 SYMATTR Value 1000 TEXT -648 -472 Left 0 !.tran 0 5ms 0 1u TEXT -648 -432 Left 0 !.ic V(in1)=2.7 TEXT -648 -512 Left 0 ;555 Radio Modem |
#5
![]() |
|||
|
|||
![]()
On 24 Mar, 18:22, "dave.harper" wrote:
On Mar 23, 3:00*pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. *I have 3 RC low-pass filters and the output looks relatively sine-like. *Thanks to everyone that provided good suggestions! *Here's the schematic in LTSpice (comments appreciated): An inductor really does make a big difference for these kind of jobs and only costs pennies. I've tacked on an LC filter to your drawing. Output is 5Vpkpk sine at very low distortion. (filter is a 3rd order, Chebyshev, low pass, with 6db passband ripple and a Zero notch at 6kHz. Components rounded to preferred values) [replacement for LTlist...] Version 4 SHEET 1 1748 680 WIRE -80 -528 -160 -528 WIRE 592 -528 0 -528 WIRE -80 -496 -80 -528 WIRE -160 -464 -160 -528 WIRE 464 -368 32 -368 WIRE 144 -304 80 -304 WIRE 80 -256 80 -304 WIRE 144 -240 144 -304 WIRE 160 -240 144 -240 WIRE 416 -240 416 -256 WIRE 416 -240 384 -240 WIRE -160 -176 -160 -400 WIRE 0 -176 0 -528 WIRE 0 -176 -160 -176 WIRE 160 -176 0 -176 WIRE 464 -176 464 -368 WIRE 464 -176 384 -176 WIRE -592 -144 -592 -192 WIRE -544 -144 -592 -144 WIRE -432 -144 -464 -144 WIRE -352 -144 -352 -192 WIRE -352 -144 -432 -144 WIRE -352 -112 -352 -144 WIRE 160 -112 96 -112 WIRE 592 -112 592 -528 WIRE 592 -112 384 -112 WIRE -592 -96 -592 -144 WIRE -432 -96 -432 -144 WIRE 32 -96 32 -368 WIRE 32 -96 -160 -96 WIRE 160 -48 144 -48 WIRE 448 -48 384 -48 WIRE 448 -32 448 -48 WIRE -592 16 -592 -16 WIRE -432 16 -432 -16 WIRE -352 16 -352 -48 WIRE -160 32 -160 -16 WIRE 144 32 144 -48 WIRE 144 32 -160 32 WIRE 848 48 784 48 WIRE 960 48 912 48 WIRE 448 64 448 32 WIRE 144 80 144 32 WIRE 208 80 144 80 WIRE 96 128 96 -112 WIRE 128 128 96 128 WIRE 576 144 560 144 WIRE 640 144 576 144 WIRE 784 144 784 48 WIRE 784 144 720 144 WIRE 832 144 784 144 WIRE 960 144 960 48 WIRE 960 144 912 144 WIRE 1104 144 960 144 WIRE 1152 144 1104 144 WIRE 96 160 96 128 WIRE 1104 224 1104 144 WIRE 96 240 -64 240 WIRE -64 256 -64 240 WIRE 784 256 784 144 WIRE 960 256 960 144 WIRE 96 288 96 240 WIRE -64 336 -224 336 WIRE -224 352 -224 336 WIRE 784 352 784 320 WIRE 960 352 960 320 WIRE 1104 352 1104 304 WIRE -64 384 -64 336 WIRE -224 464 -224 432 WIRE -224 464 -368 464 WIRE -224 480 -224 464 FLAG -592 16 0 FLAG 80 -256 0 FLAG -592 -192 +5V FLAG 416 -256 +5V FLAG -352 16 0 FLAG -432 16 0 FLAG -352 -192 +2.5V FLAG 448 64 0 FLAG -80 -496 0 FLAG 208 80 +5V FLAG -64 448 0 FLAG 96 352 0 FLAG -224 544 0 FLAG 1104 352 0 FLAG 960 352 0 FLAG 784 352 0 FLAG 576 144 Square FLAG 1152 144 Sineout FLAG 128 128 Square SYMBOL voltage -592 -112 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 0 -66 54 Left 0 WINDOW 3 47 51 Left 0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL res -560 -128 R270 WINDOW 0 32 56 VTop 0 WINDOW 3 0 56 VBottom 0 SYMATTR InstName R6 SYMATTR Value 1k SYMBOL res -448 -112 R0 SYMATTR InstName R7 SYMATTR Value 1k SYMBOL polcap -368 -112 R0 SYMATTR InstName C3 SYMATTR Value 10µ SYMBOL Misc\\NE555 272 -144 R0 SYMATTR InstName U1 SYMBOL cap 432 -32 R0 SYMATTR InstName C1 SYMATTR Value 10nF SYMBOL res -176 -192 R0 SYMATTR InstName R2 SYMATTR Value 33500 SYMBOL res -176 -112 R0 SYMATTR InstName R1 SYMATTR Value 1000 SYMBOL cap -176 -464 R0 SYMATTR InstName C2 SYMATTR Value .01µF SYMBOL cap -80 384 R0 SYMATTR InstName C4 SYMATTR Value .08µF SYMBOL res -80 240 R0 SYMATTR InstName R3 SYMATTR Value 1000 SYMBOL cap 80 288 R0 SYMATTR InstName C10 SYMATTR Value .08µF SYMBOL res 80 144 R0 SYMATTR InstName R8 SYMATTR Value 1000 SYMBOL cap -240 480 R0 SYMATTR InstName C11 SYMATTR Value .08µF SYMBOL res -240 336 R0 SYMATTR InstName R12 SYMATTR Value 1000 SYMBOL ind 928 128 R90 WINDOW 0 5 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName L1 SYMATTR Value 15m SYMBOL cap 912 32 R90 WINDOW 0 0 32 VBottom 0 WINDOW 3 32 32 VTop 0 SYMATTR InstName C5 SYMATTR Value 47n SYMBOL cap 944 256 R0 SYMATTR InstName C6 SYMATTR Value 680n SYMBOL cap 768 256 R0 SYMATTR InstName C7 SYMATTR Value 680n SYMBOL res 736 128 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R4 SYMATTR Value 330 SYMBOL res 1120 320 R180 WINDOW 0 36 76 Left 0 WINDOW 3 36 40 Left 0 SYMATTR InstName R5 SYMATTR Value 1k8 TEXT -648 -472 Left 0 !.tran 0 50ms 0 1u TEXT -648 -432 Left 0 !.ic V(in1)=2.7 TEXT -648 -512 Left 0 ;555 Radio Modem |
#6
![]() |
|||
|
|||
![]()
On Mar 24, 3:56*pm, wrote:
On 24 Mar, 18:22, "dave.harper" wrote: On Mar 23, 3:00*pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. *I have 3 RC low-pass filters and the output looks relatively sine-like. *Thanks to everyone that provided good suggestions! *Here's the schematic in LTSpice (comments appreciated): An inductor really does make a big difference for these kind of jobs and only costs pennies. I've tacked on an LC filter to your drawing. Output is *5Vpkpk sine at very low distortion. (filter is a 3rd order, Chebyshev, low pass, with 6db passband ripple and a Zero notch at 6kHz. Components rounded to preferred values) [replacement for LTlist...] That is a nicer output, but that also requires a 15mH coil. Wouldn't that be a little big? This will be going into a small payload container with 3" diameter. |
#7
![]() |
|||
|
|||
![]()
On 25/03/2010 12:37 PM, dave.harper wrote:
On Mar 24, 3:56 pm, wrote: On 24 Mar, 18:22, wrote: On Mar 23, 3:00 pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. I have 3 RC low-pass filters and the output looks relatively sine-like. Thanks to everyone that provided good suggestions! Here's the schematic in LTSpice (comments appreciated): An inductor really does make a big difference for these kind of jobs and only costs pennies. I've tacked on an LC filter to your drawing. Output is 5Vpkpk sine at very low distortion. (filter is a 3rd order, Chebyshev, low pass, with 6db passband ripple and a Zero notch at 6kHz. Components rounded to preferred values) [replacement for LTlist...] That is a nicer output, but that also requires a 15mH coil. Wouldn't that be a little big? This will be going into a small payload container with 3" diameter. Amateur rocket? |
#8
![]() |
|||
|
|||
![]()
On 25 Mar, 02:37, "dave.harper" wrote:
On Mar 24, 3:56*pm, wrote: On 24 Mar, 18:22, "dave.harper" wrote: On Mar 23, 3:00*pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. *I have 3 RC low-pass filters and the output looks relatively sine-like. *Thanks to everyone that provided good suggestions! *Here's the schematic in LTSpice (comments appreciated): An inductor really does make a big difference for these kind of jobs and only costs pennies. I've tacked on an LC filter to your drawing. Output is *5Vpkpk sine at very low distortion. (filter is a 3rd order, Chebyshev, low pass, with 6db passband ripple and a Zero notch at 6kHz. Components rounded to preferred values) [replacement for LTlist...] That is a nicer output, but that also requires a 15mH coil. *Wouldn't that be a little big? *This will be going into a small payload container with 3" diameter. They're about the size of 0.4W resistors but if you're stuck for space then it's not an option. I had in mind this ... 'Epcos' part# B82144A2156J000 A pic of a similar item ... http://uk.farnell.com/epcos/b78108s1...646?Ntt=608646 Or a different body style but more expensive ... http://uk.farnell.com/murata-power-s...44?Ntt=1077044 |
#9
![]() |
|||
|
|||
![]()
dave.harper wrote:
On Mar 23, 3:00 pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. I have 3 RC low-pass filters and the output looks relatively sine-like. Thanks to everyone that provided good suggestions! Here's the schematic in LTSpice (comments appreciated): If a well-designed Wien bridge oscillator gets hammered by RFI, you're somewhat depending on luck that an active filter doesn't have the same problem. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com |
#10
![]() |
|||
|
|||
![]()
On Wed, 24 Mar 2010 14:02:12 -0700, Tim Wescott wrote:
dave.harper wrote: On Mar 23, 3:00 pm, John Larkin wrote: On Tue, 23 Mar 2010 12:39:59 -0700 (PDT), "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. A lowpass filter is appropriate. You're trying to kill the higher (odd) harmonics but there's no signal below the fundamental, excepting DC maybe. A dual-stage RC lowpass would be pretty good, if you set the -3 dB point around 2 KHz. A higher-order filter, active or LC, would be even better. An LC filter isn't unreasonable at 2 KHz. John I modeled a few low pass filters, and think this is the best solution. I have 3 RC low-pass filters and the output looks relatively sine-like. Thanks to everyone that provided good suggestions! Here's the schematic in LTSpice (comments appreciated): If a well-designed Wien bridge oscillator gets hammered by RFI, you're somewhat depending on luck that an active filter doesn't have the same problem. How many _well designed_ Wien bridge oscillators have you seen that get hammered by EMI/RFI? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FA: Heathkit G-2 Sine/Square Wave Generator 1948 LAST DAY! | Equipment | |||
FA: Heathkit G-2 Sine/Square Wave Generator 1948 LAST DAY! | Equipment | |||
Need manual for RCA WA-44C sine/square wave generator | Boatanchors | |||
Need manual for RCA WA-44C sine/square wave generator | Equipment | |||
Need manual for RCA WA-44C sine/square wave generator | Equipment |