Author Topic: Simple Sinusoidal Oscillators  (Read 36053 times)

Picuino and 5 Guests are viewing this topic.

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 8448
  • Country: ro
Re: Simple Sinusoidal Oscillators
« Reply #75 on: June 01, 2026, 01:51:50 pm »
cannot build a low distortion oscillator unless

- it uses a long time constant feedback loop (a lamp in the old designs)

There is at least one trick to bypass that inconvenient (a trick other than running open loop, like you do when you use a DAC).  If you have a sinusoidal oscillator that provides both sin and cos outputs (a quadrature oscillator), you can find the amplitude (in theory) instantaneous, by analog squaring the outputs then sum them together, because sin2+cos2=1 at any moment during the period of an oscillation.  This way you don't need to wait for the peak of an oscillation in order to measure the signal amplitude, and you don't need an integrator with a long constant time (like in the light bulb filament trick).

There were a few application notes about the method of the squared sin and cos.  Unfortunately I don't know any AN by heart, but I remember there was at least one implementation example here, on the EEVblog forum:  https://www.eevblog.com/forum/projects/low-distortion-audio-oscillator-stabilized-via-trigonometric-identity/

Another similar example:  https://keith-snook.info/wireless-world-articles/Wireless-World-1982/Fast%20amplitude%20stabilisation%20on%20an%20RC%20oscillator.pdf



Aside from that, when it was all analog only, there were a lot of research and neat tricks to generate low distort sinusoidal signals.  One I remember is to use 2 opamps in a Wien oscillator, instead of just one opamp, in order to avoid any distortions that my be induced by the finite CMRR value of opamp. 

In the 2 inverting opamps topology, both opamps were operated with the positive input at ground, so a virtually zero CMRR swing, while the version with just 1 non-inverting opamp was seeing the full amplitude swing of the generated signal at its inputs, as a common mode signal.  Common mode input signals in an opamp are rejected, indeed, but this rejection is not perfect.  It will add considerable distortions when we talk about distortions level in the range of -100dBc or better.

https://keith-snook.info/wireless-world-articles/Wireless-World-1981/Wien-bridge%20oscillator%20with%20low%20harmonic%20distortion.pdf



Another funny trick was to sum up the signals from different points of the oscillator (different phases), such that the 3rd harmonic (the biggest contributor to THD) was eventually cancelling out itself.  ;D
https://keith-snook.info/wireless-world-articles/Wireless-World-1982/Phase-shifting%20oscillator%20-%20Roger%20Rosens.pdf
 
The following users thanked this post: peter-h

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 6072
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #76 on: June 01, 2026, 02:27:29 pm »

There is at least one trick to bypass that inconvenient (a trick other than running open loop, like you do when you use a DAC).  If you have a sinusoidal oscillator that provides both sin and cos outputs (a quadrature oscillator), you can find the amplitude (in theory) instantaneous, by analog squaring the outputs then sum them together, because sin2+cos2=1 at any moment during the period of an oscillation.  This way you don't need to wait for the peak of an oscillation in order to measure the signal amplitude, and you don't need an integrator with a long constant time (like in the light bulb filament trick).

There were a few application notes about the method of the squared sin and cos. 

Might be from a State Variable approach, where the Sine and Cos are naturally produced. Here squaring the results should be easy and little filtering required.

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 5980
  • Country: gb
  • Doing electronics since the 1960s...
Re: Simple Sinusoidal Oscillators
« Reply #77 on: June 01, 2026, 03:54:08 pm »
This is a really clever approach but I think it actually gains you little or nothing, because for it to work you need the sin and cos outputs to have an exact phase relationship, otherwise the derived amplitude will not be 1, and any error there will produce an error in the correction signal, which is the same thing as introducing distortion.

I think there is no free lunch :)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3312
  • Country: au
Re: Simple Sinusoidal Oscillators
« Reply #78 on: June 01, 2026, 09:07:01 pm »
This is a really clever approach but I think it actually gains you little or nothing, because for it to work you need the sin and cos outputs to have an exact phase relationship, otherwise the derived amplitude will not be 1, and any error there will produce an error in the correction signal, which is the same thing as introducing distortion.
It's a trade off, you gain a much lower ripple on the control signal, which you would still filter, but now control at low oscillator frequencies would be better.
You also remove any peak-detector currents.

Of course, there is also a mid-ground of a full wave 2 phase rectifier, which avoids squaring and reduced ripple and peaks, but not by as much.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 5980
  • Country: gb
  • Doing electronics since the 1960s...
Re: Simple Sinusoidal Oscillators
« Reply #79 on: June 01, 2026, 09:27:19 pm »
OK, yes, I see this approach will give you much less ripple on the control signal.

But how do you make a "naturally sin cos" oscillator?
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 6072
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #80 on: June 01, 2026, 11:24:50 pm »
OK, yes, I see this approach will give you much less ripple on the control signal.

But how do you make a "naturally sin cos" oscillator?

As we mentioned earlier, look at a State Variable approach, it has cascaded integrators which produce the Sine and Cosine waveforms "naturally" ;)

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3312
  • Country: au
Re: Simple Sinusoidal Oscillators
« Reply #81 on: June 01, 2026, 11:58:18 pm »
OK, yes, I see this approach will give you much less ripple on the control signal.

But how do you make a "naturally sin cos" oscillator?

As mentioned above, dual integrators.
Here is an example I posted in another thread, that compensates for the finite Opamp GBW. (final gain control not shown)

https://www.eevblog.com/forum/projects/two-integrator-analog-ode-solver-wont-hold-a-stable-oscillation/msg6274492/#msg6274492
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: es
    • Picuino
Re: Simple Sinusoidal Oscillators
« Reply #82 on: June 02, 2026, 09:40:12 am »
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: es
    • Picuino
Re: Simple Sinusoidal Oscillators
« Reply #83 on: June 02, 2026, 04:37:11 pm »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19183
  • Country: us
  • DavidH
Re: Simple Sinusoidal Oscillators
« Reply #84 on: June 02, 2026, 08:40:04 pm »
It's a trade off, you gain a much lower ripple on the control signal, which you would still filter, but now control at low oscillator frequencies would be better.

Some old RF designs use sampling of the oscillator signal to determine phase or amplitude.  The same thing could be done here but without the typical sampler complexity since it is low frequency.  Frequency counters make gated measurements in the same sort of way, and some integrators can be gated to measure a specific part of a signal with an integrated measurement over many cycles.

But how do you make a "naturally sin cos" oscillator?

The state variable oscillator is the major way.  With the integrators in series, and each having an accurate 90 degree phase shift over a wide frequency range, accurate sine and cosine signals are available.  Trim the time constant of one integrator to match the amplitudes.

A small amount of digital logic can produce quadrature square waves which can then be filtered to sine and cosine waves.  Do this with a pair of switched capacitor filters and the results are quite good.

Do a search for "quadrature oscillator" for more examples.
 

Offline amateur1

  • Newbie
  • Posts: 4
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #85 on: June 04, 2026, 07:26:56 am »
?s re tank frequency...


... The LC-tank frequency is about 1.5 MHz,...


How do you arrive at 1.5MHz, and is this for the tank with L 10mH and C 10nF?

More than one calculator I referenced come up with just under 16K (one of them gives  "1.5915e+4   Hertz"), which is around what the simulator will show as frequency if frequency is added (inductor scope, properties, show info) to the inductor scope...
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 4118
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #86 on: June 04, 2026, 12:09:56 pm »
?s re tank frequency...


... The LC-tank frequency is about 1.5 MHz,...


How do you arrive at 1.5MHz, and is this for the tank with L 10mH and C 10nF?

More than one calculator I referenced come up with just under 16K (one of them gives  "1.5915e+4   Hertz"), which is around what the simulator will show as frequency if frequency is added (inductor scope, properties, show info) to the inductor scope...

1.5 MHz comes from your original L and C values of 100uH and 100pF.
 

Offline SteveThackery

  • Super Contributor
  • ***
  • Posts: 3300
  • Country: gb
  • 50 year novice
Re: Simple Sinusoidal Oscillators
« Reply #87 on: June 04, 2026, 12:19:12 pm »
What do people think about a software sine wave generator? Does it have a place in this thread? In the past I've used a 6-pin PIC to generate a sinewave from an in-memory sine lookup table with interpolation. Never measured the harmonics, though.
 
The following users thanked this post: Picuino

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19183
  • Country: us
  • DavidH
Re: Simple Sinusoidal Oscillators
« Reply #88 on: June 04, 2026, 01:59:12 pm »
What do people think about a software sine wave generator? Does it have a place in this thread? In the past I've used a 6-pin PIC to generate a sinewave from an in-memory sine lookup table with interpolation. Never measured the harmonics, though.

I have done a DDS implemented in software with a timer interrupt and digital-to-analog converter, but not to generate quadrature signals although this would be easy to add.  Distortion depends on the digital-to-analog converter and maybe timing jitter.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3312
  • Country: au
Re: Simple Sinusoidal Oscillators
« Reply #89 on: June 04, 2026, 11:37:00 pm »
What do people think about a software sine wave generator? Does it have a place in this thread?
In the past I've used a 6-pin PIC to generate a sinewave from an in-memory sine lookup table with interpolation. Never measured the harmonics, though.
Certainly.
Audio DACs continue to drop in price and improve SNR, and MCUs increase in speed and capability, so live-sine calculations are even practical (no tables needed).

There are sound card based sine generators on PCs, that show what is possible, MCUs can drive i2s DAC quite easily.

Here is one example I've used over the years (and helped improve   8) )
https://www.daqarta.com/

That even has a high-performance frequency counter too.
Even tho Audio ADC sample rates are modest, with sine signals you have multiple readings with which to interpolate a true zero crossing.
I just checked on my PC and the Freq Counter wobbles around about 40ppb on a 999.0003Hz sine signal
 
The following users thanked this post: SteveThackery

Offline amateur1

  • Newbie
  • Posts: 4
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #90 on: June 05, 2026, 08:45:37 am »
1.5 MHz comes from your original L and C values of 100uH and 100pF.

Oops... (obviously) my bad, was working from memory (and I think also a local version at the time), and appears memory forgot I must have actually applied the values seen in the activity document* at https://wiki.analog.com/university/courses/electronics/comms-lab-peltz-osc.

Sorry for the noise.

*(which I also see now says it is an old revision, although history seems to show as latest, and failing to see how to get to any later revision)
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 4118
  • Country: us
Re: Simple Sinusoidal Oscillators
« Reply #91 on: June 05, 2026, 12:13:18 pm »
Btw - you can change Falstad's simulation time step in the Options -> Other Options dialog.

The AIs say that a good starting point is to have the time step be less than the oscillator period / 100.
 

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 4831
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Simple Sinusoidal Oscillators (Peltz oscillator)
« Reply #92 on: September 14, 2026, 12:16:59 am »
Just wanted to share my "research" into the Peltz oscillator.

I built it (breadboarded):



With those components I got an output of 1 MHz @ 1.6V peak-to-peak

With a 1 nF capacitor, 495 KHz @ 1.7V P-P
With a 10 nF cap, 165 KHz @ 1.3 V P-P
With a 0.1 μF cap, 52 KHz @ 450 mV P-P

Circuit seems best suited for medium HF usage.
Fairly low output but a nice-looking sine wave.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 654
  • Country: pl
Re: Simple Sinusoidal Oscillators
« Reply #93 on: September 16, 2026, 11:11:18 am »
The voltage is low because it is limited by the conduction of B-C junctions

This circuit operates over a wide frequency range, but changing the capacitor also changes the quality factor of the LC circuit.
 

Offline rf-fil

  • Regular Contributor
  • *
  • Posts: 132
  • Country: au
    • VK2ZJ at QRZ
Re: Simple Sinusoidal Oscillators
« Reply #94 on: Yesterday at 12:53:06 am »
Another cool property of the Peltz oscillator is that it can oscillate with ridiculous L/C combinations, and it needs 1 x L and 1 x C, which makes it useful for making a GDO / Dip meter. I built this one when I was a kid - it worked really well for tuning up resonant circuits. All it needed was a single variable cap from a radio, and a set of plug-in inductors. It worked up to something like 200MHz.

« Last Edit: Yesterday at 12:59:50 am by rf-fil »
-VK2ZJ
 
The following users thanked this post: RoGeorge

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22399
  • Country: gb
  • 0999
Re: Simple Sinusoidal Oscillators
« Reply #95 on: Yesterday at 07:38:15 pm »
If a variable frequency is required, then one way is to use a wave shaping circuit and a triangle wave oscillator. It has the advantage that the frequency can be changed by varying a single resistor or even voltage controlled, since it's easy to build a triangle wave VCO.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 7166
  • Country: de
Re: Simple Sinusoidal Oscillators
« Reply #96 on: Yesterday at 09:13:26 pm »
If a variable frequency is required, then one way is to use a wave shaping circuit and a triangle wave oscillator. It has the advantage that the frequency can be changed by varying a single resistor or even voltage controlled, since it's easy to build a triangle wave VCO.

Yeah, that's the old ICL8038/XR2206 approach.
Unfortunately, it has the "peak nipples" on the sine wave (a fact not mentioned in the data sheets).

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19183
  • Country: us
  • DavidH
Re: Simple Sinusoidal Oscillators
« Reply #97 on: Today at 02:22:11 am »
There are a few different ways to do sine shaping including piecewise approximation using diodes or transistors, or curve fitting using differential pairs.  A more modern analog method is with a switched capacitor filter with a square wave input.

I like how both my example below, and the one given by Zero999 above, use additional diodes for temperature compensation.
« Last Edit: Today at 03:54:09 am by David Hess »
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 654
  • Country: pl
Re: Simple Sinusoidal Oscillators
« Reply #98 on: Today at 05:53:21 am »
@Zero999
In the simulation, this circuit performs better than other similar ones.
2918172-0
 THD = 0.25%.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 17200
  • Country: de
Re: Simple Sinusoidal Oscillators
« Reply #99 on: Today at 08:08:07 am »
The sine shaper circuit may be temperature dependent - both with the THT changing with temperature and the amplitude changing with temperature.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf