Square + triangle = sine (almost)

See

formatting link

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs
Loading thread data ...

That's neat, are you making a 'few' bit DAC?

George H.

Reply to
George Herold

but

That's Great! Thanks, I tried to filter a square wave into a sine and was deeply disappointed. (If you filtered it hard enough there was just not enough left.)

George H.

Reply to
George Herold

snipped-for-privacy@esterbrook.com=20

wave

done.

I first saw it in a synchro to digital converter about 1973. I had to = think=20 hard for a while before i "got" it.

Reply to
JosephKK

Here is a dimensioned citcuit using this principle, just a differential amp like in the app-note. .------o--------o--------------------- +2.5V | | | .-. .-. .-. 13.5k | |/ | |10k | | 10k |/| | | 10k| | ___ \ /'-' '-' '-' .--|___|--. \ | | | | | | | | | |\ | Sineshaper | | o------o---|-\ | Out 5Vpp | | | | >--o--- | o--------)-------o--|+/ | | | | |/ OPA365 | | | .-. | | | | | Triangle | | | | |10k In ___ | |/ \| '-' o-|___|-)--o-| Array |-. | 5Vpp 10k | | |>

Reply to
Ban

Which is nothing more than the analog variant of a transversal filter that you can build from a divider, a shift register and a few weighted summing resistors.

--
Thanks,
Fred.
Reply to
Fred Bartoli

You need a high Q filter, of course. My induction heater makes an excellent sine wave from a fairly sharp square input (t_r = 100ns, so there's plenty of harmonics). The tank has Q around 10-20 depending on load, and obviously enough, since the fundamental is key to induction heating, there is plenty of signal left. :-)

If you filtered a square with, say, a row of RCRC's, you'd get terrible results because the asymptotic attenuation is pretty weak and the knee is too soft (you can't make a Q > 1/3 or something like that). In time-domain terms, you're turning square into triangle with one RC (integrator), then triangle into parabola, then parabola into cubic, and so on. Eventually you'll get a fair approximation of a sine wave (i.e., the harmonics are attenuated sufficiently), but because you need to be in the asymptotic region to get useful attenuation of the harmonics, your signal of interest disappears almost as much.

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

ith

you

and

s

It is the same idea but in this case, it is made from a triangle wave which we have to start with instead of needing to make a higher frequency first.

Reply to
MooseFET

ve

m
h
o
r

The first idea: The comparators are a few bit ADC and the resistors to make the waveform are a few bit DAC.

The second idea: The idea is that a PWM signal at perhaps a few MHz can be made. This PWM signal would be nonlinear with the triangle's voltage and thus make it into a more rounded shape.

Reply to
MooseFET

The only place I can remember using it in an actual product was for linearizing a flat-face CRT sweep (RADAR)... and there it was piecewise _curve_ fitting. ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

Breakpoint amps are nearly always a crutch. One poor guy I tried to help (15 years back) ignored my advice and wound up with a multi-diode breakpoint amp stuck inside a crystal oven to keep the breakpoints from going all over the place with temperature. Blech. (It was in a fancy measurement system, too. Got all sorts of industry awards.)

The Widlar approach (National AN4, Figure 8) uses BJT saturation to make nice sharp breakpoints that don't drift much. Of course you have to wait for the transistor to come out of saturation.

About the only good use of breakpoint amps I've seen is inside complicated FB loops, e.g. to approximately correct for the nonlinearity of VCOs and heaters. This reduces the variation of loop gain and so makes frequency compensation easier. Drift and inaccuracy are not a big problem in those sorts of applications.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Ah, yes! Thanks for the reminder! I also linearized a frequency hopping VCO for OmniSpectra _many_ years ago... for jumping close to desired frequency, so the PLL lock was faster... a cavity beast :-)

I would never use _just_ diodes, rather use them with OpAmps or comparators, such as...

formatting link

(A Christmas gift, 2007. But he remains a cranky old git :-)

formatting link

formatting link

formatting link
...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

done.

Try knitting him some mittens this year, maybe? Active diode clamps have been round for a day or too!

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

See

formatting link
;-) ;-) ;-) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

(page 85.2)

--
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: don@tinaja.com

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

tter

Oh, they work dandy with just diodes, especially with +/-24V power. I learned on NIM bin power (highly regulated +/- 24V, highly regulated +/- 12V) and you can get away with a lot of things that newbies using 3.3V aren't gonna like. Nor IC designers, apparently.

For current sources, we just hung a resistor from +24 to a PNP emitter, and wired the base to +12. The only thing more convenient would be (and it HAS been done) +/- 200V supplies. With those, you omit the transistor.

More volts means less bother. It's a great relief; when something has to work on a single +2V supply, my blood pressure rises and I snarl at my squirrels.

Reply to
whit3rd

,

to

Whoa! That's brilliant, you should get a patent. Not just for what it is, but it REMOVES THE AUTOCORRELATION glitch. It follows, from the Wiener-Hopf theorem, that the crude XR2206 style diode shaping will now be VERY effective; if your triangle wave is accurate enough, and your summation really takes out the cusp, then the crude diode-array trim can get you much further, to -80 dB or better.

The low level of high harmonic content in F-space looks nice, but it doesn't do justice to the full glory of the scheme, in the context of building a sinewave generator on a chip. Tanh and diodes are easy, so are triangles. Getting the coefficients accurate enough on the summation might want trimmed resistors, but that can be done on-chip, too.

Reply to
whit3rd

Thanks, but I very much doubt that I'm the first one to think of it. Works great though.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

done.

The first schematic looks like the start of a decent guitar fuzzbox pedal! I think one could set more breakpoints with different slopes by using more comparators with the breakpoint voltage on the non inverting inputs and putting resistors in series with the diodes, right?

Back before guitar practice amps with DSP became commodity hardware, Peavey had a patented technology called "TransTube" that purported to make a solid state amp have a tone more like a tube amp. I wonder if they used a similar piecewise linear technique to make the amp have a softer clipping characteristic.

Reply to
Bitrex

=A0With

how you

on and

tristate

degrees

Just to be off the wall, what is the integral of a triangle wave? How about the second and third integrals?

Reply to
JosephKK

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.