Square + triangle = sine (almost)

J

JosephKK

Jan 1, 1970
0
Yep. "Piecewise-Linear", aka break-point analysis... taught in better
engineering schools ;-)

...Jim Thompson

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

Ban

Jan 1, 1970
0
Darwin said:
I also think it is more a tanh shaping. I used the transistor shaping
network for a VCO some years ago and it worked nice, if you do not
expect an extremely low distortion rating. A problem is that the
output amplitude (before the opamp) is rather small and so there can
be noise problems.

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 | | |> <| | ===
| | | | | GND
| .-. .-. .-. .-.
| | | | |47 | | | |
390| | | | | 47| | | |390
| '-' '-' '-' '-'
| | | | |
| === '---o----' ===
| GND | GND
| |
o-----. |
| | |
\| | |/
|---o--| Array
<| |> CA3046
| |
1k 1k
| |
'----------o-----------------------o -2.5V
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

sorry for the size. I can not promise 0.1% THD like Phil Hobbs, but around
0.3% is achievable. The opamp goes slightly into saturation, so it cuts the
remaining corners of the triangle wave, much like subtracting them. I do not
throw away dynamic range like in the app.note. The amplitude on the base of
the diff. pair should be around */- 4Vt or 180mVpp for minimum distortion.

ciao Ban
 
F

Fred Bartoli

Jan 1, 1970
0
MooseFET a écrit :
The waveform I drew can be made by simply adding two pulse trains
with
different duty cycles. The fact that 3 time 60 degrees is 180 degrees
is how you can get the 3rd harmonic to go away.

If you use more steps, you can get the first N harmonics to drop to
zero. The same is true for line segments instead of steps.

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

Tim Williams

Jan 1, 1970
0
George Herold said:
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.)

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
 
D

Don Lancaster

Jan 1, 1970
0
MooseFET said:
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.


<http://www.tinaja.com/glib/hackar4.pdf> (page 85.2)

<http://www.tinaja.com/magsn01.asp>

--
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: [email protected]

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

JosephKK

Jan 1, 1970
0
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.

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

Don Klipstein

Jan 1, 1970
0
Jim Thompson wrote:


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.

A little over a decade ago, I worked along with 2 partners on what we
hoped would be a patentable significant on an "electric guitar fuzzbox".
As in able to get a patent for improvement over prior art in US patents
by Pittman and Scholz (sp).

"Our" device received rave reviews where we showed it off.

"We" abandoned the project after determining that "we" could make a
majority as much money working at entry level at a big-name fast-food
restaurant as "we" could getting this device manufactured and selling it,
even should (unlikely) sales volume get the cost of patenting it to be
negligible-per-unit, let alone battling whoever tries their hand at
infringing "our patent" in a case likely costing upper 10's of kilobucks
to hundreds of kilobucks (I can't rule out megabucks) in a court battle.

One of "us" (we 3) even schmoozed the likely examiner of the
prospective patent application to extent of hearing from the likely
examiner that a patent would likely be granted.

This "improved fuzzbox" never went to any actually filed patent
application. It was since published on the web, at least significantly
where web searching for it or major segments of it are best found by
AND-ing search terms of "LXH2" and either of the 2 major brands of British
electric guitar amplifiers - Fender or Marshall.

- Don Klipstein ([email protected])
 
D

Don Klipstein

Jan 1, 1970
0
JosephKK wrote: said:
Just to be off the wall, what is the integral of a triangle wave?
How about the second and third integrals?

Integral of a triangle wave is a "nearly-sinusoid" having periodic
parabolic arches.

This reminds me of a story...

During my 2nd (and successful) attempt to pass "Electronic
Instrumentation Laboratory" course at Drexel U. around 1983-1984 or so,
I had to handle the 10th of 10 weekly "laboratory projects".

That was an "analog computer" that modelled a damped resonant item such
as a "damped pendulum". This used a circuit having two op-amp integrators
with arrangement so as to model K1 * y'' + K2 * y' plus K3 * y = zero.

I was one of only 2 out of 78-or-so students taking that course that
semester who managed to make this thing work. (Not that I did so well or
better most of elsewhere in my attempt for an EE degree...)

I got the circuit to work by recognizing a "parabola arch wave" on an
oscilloscope to be visibly discernable from a sinusoid, and subsequently
setting "initial conditions" short of any of the op-amps clipping.
(The parabolic arch waveform was due to a heavily clipped sinusoid
being integrated twice.) Fixing the clipping issue achieved the
oscillation damping-out rather than growing.

- Don Klipstein (Jr) [email protected]
 
S

Somebody

Jan 1, 1970
0
Sure enough, as does the ICL8038.

Avoid this chip like the plague. At the transiition from
one quadrant to the next there is one almighty noise
spike.
 
B

Ban

Jan 1, 1970
0
MooseFET said:
At lowish frequencies, you can do this:

---------------------------------------/\/\---+----Out
! !
+-----------------/\/\----+-/\/\---+---/\/\----+
! ! ! !
! --!-\ ! !
In ---+--------!+\ ! >-- !
! >---+--/\/\--+---!+/ !
--!-/ ! ! !
! ! ---/\/\--GND !
GND--/\/\--+--/\/\---+------------------------/\/\--

With rail to rail op-amps, you can get a total of 6 knees from Vee to
Vcc in the output
swing.

This is indeed a very cute circuit, in fact I had built something similar,
but with one more opamp.

ciao Ban
 
J

JosephKK

Jan 1, 1970
0
Avoid this chip like the plague. At the transiition from
one quadrant to the next there is one almighty noise
spike.

Dude, the chip was new maybe 40 years ago and quite obsolete. Is
someone wildcatting poor work alikes out there?
 
J

JosephKK

Jan 1, 1970
0
Gradually becomes sine, though smaller and smaller amplitude. I've
used such a scheme over small frequency ranges... in an ASIC, of
course, where parts are cheap :)

...Jim Thompson

That is what integrating the Fourier series term by term tells us.
 
T

Tim Williams

Jan 1, 1970
0
JosephKK said:
That is what integrating the Fourier series term by term tells us.

Or quite simply, when you stack up n integrators, you get 20*n dB/decade
attenuation for frequencies away from fT. For convinience, set your
integrators' fTs to the fundamental.

I suppose you could do the same with differentiators if you had a lot of LF
noise on your signal too (or wanted to bandpass to a harmonic).

Of course, n differentiators and integrators, with the same fT (actually,
with any fT, as long as the total has the desired gain at the peak), is an
excellent description of a particularly narrow bandpass filter. As n -->
infty, you get a delta response, so the circuit's impulse response is a
sinewave, regardless of past or present state. It's an oscillator!

Tim
 
Top