RadioBanter

RadioBanter (https://www.radiobanter.com/)
-   Homebrew (https://www.radiobanter.com/homebrew/)
-   -   Square wave to psuedo-sine wave? (https://www.radiobanter.com/homebrew/150454-square-wave-psuedo-sine-wave.html)

dave.harper March 23rd 10 07:39 PM

Square wave to psuedo-sine wave?
 
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

Tim Wescott[_3_] March 23rd 10 07:49 PM

Square wave to psuedo-sine wave?
 
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

John Larkin March 23rd 10 08:00 PM

Square wave to psuedo-sine wave?
 
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



George Herold March 23rd 10 08:14 PM

Square wave to psuedo-sine wave?
 
On Mar 23, 3:39*pm, "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?

Thanks in advance!
Dave


Start with a triangle wave, there are less harmonics to filter out.
How bad is the EMI? I like the Wein-bridge. Try using an FET opamp
for it. The only problem I've had with the wien bridge was motor-
boating of the frequency. This was finally solved by using good low
dissipation caps. (Ohh I have seen EMI fuzz.. but only with BJT
opamps.)

George H.

markp March 23rd 10 08:50 PM

Square wave to psuedo-sine wave?
 

"dave.harper" wrote in message
...
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


One possibility is to use a digital filter. These have very sharp roll-offs
(e.g. 8th order for MAX292), you basically feed the clock of the filter with
a multiple of the fundamental frequency of the filter (say 64x), and the
output is a very pure sine wave. The beauty of this is the amplitude of the
output is independent of frequency and you don't have to change filter
components:
http://electronicdesign.com/content....nd-measurement

Another solution is using a multiplexor to create an approximate sine wave
using an 8x clock followed by a filter (the example below uses a pair of
cascaded 2nd order filters). This may suit you better:
http://www.maxim-ic.com/app-notes/index.mvp/id/21

Mark.



[email protected] March 23rd 10 11:52 PM

Square wave to psuedo-sine wave?
 
On Mar 23, 3:39*pm, "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?

Thanks in advance!
Dave


Function generator. Integrate square wave to get triangle wave. Shape
triangle wave to sine wave using a couple of diodes. See

http://kitsrus.com/projects/k23.pdf

Dan

Phil Allison[_2_] March 24th 10 12:01 AM

Square wave to psuedo-sine wave?
 




Function generator. Integrate square wave to get triangle wave. Shape
triangle wave to sine wave using a couple of diodes. See

http://kitsrus.com/projects/k23.pdf


** Contrary to the OP's wishes, that POS uses op-amps.

Have you seen the ugly " sine" wave it produces ??

The diodes will rectify the RF energy.

Not even a starter.



.... Phil





[email protected] March 24th 10 12:15 PM

Square wave to psuedo-sine wave?
 
On Mar 23, 8:01*pm, "Phil Allison" wrote:


Function generator. Integrate square wave to get triangle wave. *Shape
triangle wave to sine wave using a couple of diodes. *See

http://kitsrus.com/projects/k23.pdf

** Contrary to the OP's wishes, that POS uses op-amps.

*Have you seen the ugly " sine" *wave it produces ??

*The diodes will rectify the RF energy.

* Not even a starter.

... *Phil


Contrary to what you think, the OP seems like he would be happy with a
sine wave with only 1% distortion. The diodes will rectify RF but at
the output the signal level should be several orders of magnitude
higher than the RF. So would not expect that to be a problem. The
reference to the kitsrus was to show one implementation that had an
explanation of the circuit.


Dan


Bob Eld March 24th 10 01:03 PM

Square wave to psuedo-sine wave?
 

"dave.harper" wrote in message
...
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


I would make a five pole elliptic low pass active filter breaking at about 3
kHz with a deep 80 dB notch at the third harmonic of 6 kHz. This is a dual
op amp (2 section) solution and uses a small number of resistors and caps.
You should be able to attenuate all of the harmonics at least 80 dB leaving
a pretty good sine wave.



Uwe Hercksen March 24th 10 02:06 PM

Square wave to psuedo-sine wave?
 


dave.harper schrieb:

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.


Hello,

a Wien-Robinson bridge oscillator needs a good amplitude stabilisation.
If the amplification is to low, the oscillations will damp out. I guess
there was something wrong with your amplitude stabilisation.

Bye


Don Lancaster March 24th 10 03:25 PM

Square wave to psuedo-sine wave?
 
Bob Eld wrote:
"dave.harper" wrote in message
...
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


I would make a five pole elliptic low pass active filter breaking at about 3
kHz with a deep 80 dB notch at the third harmonic of 6 kHz. This is a dual
op amp (2 section) solution and uses a small number of resistors and caps.
You should be able to attenuate all of the harmonics at least 80 dB leaving
a pretty good sine wave.




Parallax invented the ultimate in mind-numbingly simple sinewave
generators many years ago. SIX BYTES !!! of working code on a PIC!!!!

Start with page 85.3 of http://www.tinaja.com/glib/hackar4.pdf





--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email:

Please visit my GURU's LAIR web site at
http://www.tinaja.com

Vladimir Vassilevsky[_2_] March 24th 10 05:53 PM

Square wave to psuedo-sine wave?
 


Bob Eld wrote:


I would make a five pole elliptic low pass active filter breaking at about 3
kHz with a deep 80 dB notch at the third harmonic of 6 kHz. This is a dual
op amp (2 section) solution and uses a small number of resistors and caps.
You should be able to attenuate all of the harmonics at least 80 dB leaving
a pretty good sine wave.


Here is minimal solution:

http://www.abvolt.com/misc/square_to_sine.jpg

This filter makes for about 0.65% of THD; it is probably as good as it
could be done in reality with this number of components.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com




dave.harper March 24th 10 06:12 PM

Square wave to psuedo-sine wave?
 
On Mar 24, 9:06*am, Uwe Hercksen wrote:
dave.harper schrieb:

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.


Hello,

a Wien-Robinson bridge oscillator needs a good amplitude stabilisation.
If the amplification is to low, the oscillations will damp out. I guess
there was something wrong with your amplitude stabilisation.

Bye


No, I used non-linear feedback (diodes) and it worked like a champ. O-
scope showed a nice, rounded, stable wave with no clipping. It was
only when the nearby transmitter was turned on, the oscillations
damped out.

Dave

dave.harper March 24th 10 06:22 PM

Square wave to psuedo-sine wave?
 
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

[email protected] March 24th 10 08:56 PM

Square wave to psuedo-sine wave?
 
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

Tim Wescott[_3_] March 24th 10 09:02 PM

Square wave to psuedo-sine wave?
 
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

Robert Baer March 24th 10 10:16 PM

Square wave to psuedo-sine wave?
 
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?

Thanks in advance!
Dave

You have such a narrow "bandwidth" that you might consider an LC
tuned network..

John Larkin March 24th 10 11:07 PM

Square wave to psuedo-sine wave?
 
On Wed, 24 Mar 2010 11:22:28 -0700 (PDT), "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):

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



Your RC values could be optimized. Try using successively bigger
resistors and correspondingly smaller caps in successive stages. As
is, each filter stage heavily loads the previous one.

These RCs each have an unloaded 3 dB point of about 2 KHz, so three in
a row will lose about 9 dB. Making the taus a little shorter will
increase output at the expense of distortion.

I'd expect a 3-pole LC filter to be a lot better.

John


Phil Allison[_2_] March 24th 10 11:07 PM

Square wave to psuedo-sine wave?
 


"Phil Allison"


Function generator. Integrate square wave to get triangle wave. Shape
triangle wave to sine wave using a couple of diodes. See

http://kitsrus.com/projects/k23.pdf

** Contrary to the OP's wishes, that POS uses op-amps.

Have you seen the ugly " sine" wave it produces ??

The diodes will rectify the RF energy.

Not even a starter.


Contrary to what you think, the OP seems like he would be happy with a
sine wave with only 1% distortion.

** Fraid that POS has a lot more than 1% THD.


The diodes will rectify RF but at
the output the signal level should be several orders of magnitude
higher than the RF.

** The OP wants to link his device to a transmitter.

The amount of RF energy is serious.

Did you read his post at all ??


So would not expect that to be a problem.

** Yawnnnnnnnnnnnnnnnnn....



..... Phil



dave.harper March 25th 10 02:37 AM

Square wave to psuedo-sine wave?
 
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.


David Eather March 25th 10 11:13 AM

Square wave to psuedo-sine wave?
 
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?

Bob Eld March 25th 10 02:16 PM

Square wave to psuedo-sine wave?
 

"Don Lancaster" wrote in message
...
Bob Eld wrote:
"dave.harper" wrote in message

...
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


I would make a five pole elliptic low pass active filter breaking at

about 3
kHz with a deep 80 dB notch at the third harmonic of 6 kHz. This is a

dual
op amp (2 section) solution and uses a small number of resistors and

caps.
You should be able to attenuate all of the harmonics at least 80 dB

leaving
a pretty good sine wave.


Parallax invented the ultimate in mind-numbingly simple sinewave
generators many years ago. SIX BYTES !!! of working code on a PIC!!!!

Start with page 85.3 of http://www.tinaja.com/glib/hackar4.pdf
--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email:

Please visit my GURU's LAIR web site at
http://www.tinaja.com


Thanks Don. Truly weird! I plan to code it up and play around with this when
time permits. So, the original poster could put this into a single chip PIC
and forget about his square wave source. He'd still need to run a D toA to
get an analog output, would he not? Within that algorithm he could also pull
out a square wave too if needed. Frequency could be anything within the
speed of the processor with appropriate, even externally controlled internal
delays and of course be crystal controlled and very stable. Hmmm. I already
have a use for this. Thanks again.
Bob



[email protected] March 25th 10 03:57 PM

Square wave to psuedo-sine wave?
 
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

dave.harper March 25th 10 08:26 PM

Square wave to psuedo-sine wave?
 
On Mar 25, 10:57*am, wrote:
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...-4700uh/dp/608...
Or a different body style but more expensive ...http://uk.farnell.com/murata-power-s...ductor-15mh/dp...


Hm, what about this one? Looks promising:

http://search.digikey.com/scripts/Dk...me=811-2058-ND

[email protected] March 25th 10 09:02 PM

Square wave to psuedo-sine wave?
 
On 25 Mar, 20:26, "dave.harper" wrote:
On Mar 25, 10:57*am, wrote:





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...-4700uh/dp/608...
Or a different body style but more expensive ...http://uk.farnell.com/murata-power-s...ductor-15mh/dp...


Hm, what about this one? *Looks promising:

http://search.digikey.com/scripts/Dk...tail&name=811-....


Yep. Fine!.
(DigiKey 811-1302-ND for the 15mH)

John Fields March 25th 10 11:36 PM

Square wave to psuedo-sine wave?
 
On Thu, 25 Mar 2010 13:26:27 -0700 (PDT), "dave.harper"
wrote:

On Mar 25, 10:57*am, wrote:
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...-4700uh/dp/608...
Or a different body style but more expensive ...http://uk.farnell.com/murata-power-s...ductor-15mh/dp...


Hm, what about this one? Looks promising:

http://search.digikey.com/scripts/Dk...me=811-2058-ND


---
How about this:

Version 4
SHEET 1 880 680
WIRE 208 0 16 0
WIRE 208 16 208 0
WIRE 16 32 16 0
WIRE 16 128 16 112
WIRE 208 144 208 96
WIRE 336 144 208 144
WIRE 208 160 208 144
WIRE 16 256 16 208
WIRE 208 256 208 224
WIRE 208 256 16 256
WIRE 16 352 16 256
FLAG 16 352 0
SYMBOL ind 192 0 R0
SYMATTR InstName L1
SYMATTR Value .00932
SYMATTR SpiceLine Rser=110
SYMBOL cap 192 160 R0
WINDOW 0 42 38 Left 0
WINDOW 3 26 65 Left 0
SYMATTR InstName C1
SYMATTR Value .68e-6
SYMBOL voltage 16 112 R0
WINDOW 3 24 104 Invisible 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 0 1e-7 1e-7 250e-6 500e-6)
SYMATTR InstName V1
SYMATTR Value2 AC 1
SYMBOL res 0 16 R0
SYMATTR InstName R1
SYMATTR Value 10
TEXT 40 288 Left 0 !.tran .1
TEXT 40 320 Left 0 !;ac oct 256 10 10000



The coil is a Caddell-Burns 6740-61 (6.8 - 12mH) variable inductor:

http://www.caddell-burns.com/PDF/A1042.pdf

You can use it to tune to 2kHz, dead nuts, but that tunability
comes at a price:

http://www.caddell-burns.com/priceLi..._List_Pg_2.pdf

and the cap is any garden variety 0.68µF polyester cap.

JF

triode March 26th 10 10:00 AM

Quote:

Originally Posted by dave.harper (Post 702616)
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

Try a high value resistor, say 47k into a pair of reverse paralleled germanium diodes to earth. The square law "knee" will clip the signal into a psuedo sine, around 1 volt p to p. Simple, and it works at these low frequencies. Three components, give it a try. cheers

JosephKK[_3_] March 27th 10 01:18 PM

Square wave to psuedo-sine wave?
 
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. 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


With a 10% of fc range i would use an integrator first then use an
active RC bandpass filter.

JosephKK[_3_] March 27th 10 01:28 PM

Square wave to psuedo-sine wave?
 
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?


All times are GMT +1. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
RadioBanter.com