|Elliott Sound Products||Sinewave Oscillators|
Sinewave Oscillators - Characteristics, Topologies and Examples
Copyright © 2010 - Rod Elliott (ESP)
An intriguing conundrum on the Net is the constant belly-aching from many audiophools and other vested interests that "sinewaves are simple", and are therefore a poor test of an amplifier's distortion performance. If this were true, then a low distortion sinewave oscillator would not pose any problems to build, indeed, it too would be 'simple'. This being the case, I challenge the 'phools and vested interests to build a simple variable frequency sinewave generator with minimal (or no) distortion. It's simple, isn't it?
Alas, this is not the case, and there are many different schemes published that desperately attempt to obtain a low distortion sinewave, without having to revert to complex high-bitrate digital synthesis, and without using the venerable (and now unobtainable) RA53 or similar NTC thermistor. While it is comparatively easy to make a sinewave generator that has vanishingly low distortion at one or two spot frequencies, a variable generator is another matter altogether.
In this article, I will concentrate on variable oscillators, because while spot frequencies can be useful if you only need to check distortion at a couple of frequencies, most people like to be able to test filters, amplifiers, loudspeakers, and other devices that are generally expected to be able to reproduce more than one (or two) frequencies. However, there are many requirements for single-frequency sinewave oscillators, so they are not avoided.
The distortion ideally needs to be as low as possible, but anything below 0.1% starts to become rather difficult with the methods available now. It's certainly possible to improve on this, but very careful adjustment of all the parameters (time constants, allowable stabilisation range, etc.) is needed to get good results. Some comparatively simple arrangements can give very good results, but only over a limited range (using common and readily available opamps). Indeed, opamps impose many additional limitations. Distortion is usually well within acceptable limits, but not many low-cost opamps will allow operation of any oscillator topology to much beyond 20kHz. This is very limiting, as it is common for general purpose audio oscillators to have a range up to at least 100kHz, preferably more.
Note that this article is very specific - it deals only with 'linear' oscillators - those that are designed to generate a sinewave. Even more specifically, the range is limited to audio frequencies, plus at least a couple of octaves either side. Most audio oscillators are expected to be able to cover the range from about 5Hz up to at least 100kHz.
You won't find any multivibrators or other square/rectangle generators here, nor will you find RF oscillators, other than by a glancing reference.
Note that the schematics presented here are for the purpose of illustration and education, and should not be considered to be fully functional as shown. In many cases the circuits will work as described, but this is not guaranteed and cannot be assumed. Some circuits incorporating feedback stabilisation loops using other than lamps or thermistors may require some effort to ensure stability under actual operating conditions. This is an article that describes the principles - it is not a collection of projects that have been built and fully debugged.
No descriptions are provided for common function generator ICs. Basic function generators have been around for some time now, and there are several specialised ICs designed for just that purpose. However, most have mediocre distortion performance (typically around 1% for the better versions), and that limits their usefulness. Some of the ICs include the Exar XR2206, Maxim MAX038 and Intersil ICL8038, but not all are still available because they are now obsolete. If you are interested, look up the details for them - provided you don't need low distortion, one of them may be just what you need. Most use 'waveform shaping' to get a passable facsimile of a sinewave (see Section 8 - Waveform Shaping for an example). Several low cost function generators are available on-line, and most use one of the common ICs. You'll also see many DDS function generators at fairly low cost. None of the cheap function generators are suitable if low distortion is needed.
Note that power supplies and bypass capacitors are not shown in the drawings that follow. Most of the opamp circuits in this article will require ±12-15V DC supplies. Although all gain blocks are shown as opamps, in many cases you will have to build a discrete 'opamp' or the circuit will not be satisfactory at high frequencies. Most IC opamps will typically be ok up to perhaps 30kHz or so, but if you need good performance up to 100kHz or more, you'll almost always need a discrete circuit or a very fast opamp. All opamps (whether IC or discrete) need ceramic bypass caps close to the IC or other parts to prevent instability (either parasitic or continuous RF oscillation). Discrete opamps are normally needed if a lamp is used for stabilisation, because the current needed is high enough to cause many opamps to increase their distortion well beyond the quoted figures.
An oscillator has two very specific requirements. The amplifier must be able to perfectly match the losses in the frequency determining network. The frequency determining network must be arranged so that the signal fed back to the amplifier results in positive feedback. If the gain exceeds that required for oscillation, the output will be distorted, and if it's too low the oscillation will die away to nothing. These constraints apply to all analogue oscillators.
By definition, oscillators do not require an externally applied input signal, but instead use part of the output signal via a frequency selective feedback network as the input signal. It is the circuit noise and/ or offset voltage that provides the initial 'trigger' signal to the circuit when positive feedback is employed. If the gain criterion is satisfied, the output builds up over a period of time, oscillating at the frequency set by the circuit components [ 9 ].
Note: The RC networks will typically use MKT (polyester) caps and 1% metal film resistors, but for high stability it may be necessary to use capacitors with a lower thermal coefficient than the common polyester types. Polypropylene is probably one of the better options. Never use multilayer ceramic caps in any oscillator unless you actually want it to have very poor and unpredictable frequency stability with temperature variations (this isn't a common requirement in my experience ). Polyester (PET) caps have a positive temperature coefficient, and polypropylene is negative (but smaller).
The heart of any sinewave oscillator is the amplitude stabilising system. Without it, the level will continue to increase until the waveform is clipped and severely distorted, or oscillation will die out over a period of time - assuming it starts at all. The range where the amplitude is stable and has low distortion is limited, and it is simply not possible to make an amplifier with the exact gain needed and expect it to work properly. In all cases with analogue sinewave generators, some means of stabilising the amplitude is needed. This can use diodes, zener diodes, or more sophisticated AGC (automatic gain control) systems. However, the most common (and most effective) amplitude stabilisation systems have used non-linear resistances as described below.
The demise of the specialised NTC thermistor that used to be the mainstay of audio oscillators is a serious blow, because the only available alternative is a small, low current lamp. These have a positive tempco, so the feedback network needs to be rearranged. Because their current demands are comparatively high (typically up to 20mA or more), this stresses most opamps. Lamps also have a fairly fast time constant, so distortion at low frequencies can be higher than is desirable because the resistance changes during the sinewave cycle.
RA series thermistors used to be made by a number of vendors, such as ITT, GE and various others, but it seems that absolutely no-one manufactures these components any more. The Chinese make a range of audio oscillators, and one I have seen uses a small lamp use for amplitude stabilisation. There are several techniques that can be used, and each has its place. One of the biggest problems is that there is no reference material that I could find that discusses the options, and the strengths and weaknesses of each.
In short, these are the primary options ...
There is one other option too, and that's to deliberately clip the signal, and rely on a tuned filter to remove the distortion produced. Filter complexity can be quite high for a low distortion output, and the circuit may end up needing to use multi-gang (3 or more) potentiometers for tuning. Apart from being extremely hard to get, these often have poor tracking. This will also affect the distortion, and makes the amplitude stabiliser work much harder every time the frequency is changed. Amplitude stabilisation is an essential part of all oscillators, because we expect the level to remain constant as the frequency is varied. A filter can be used after a low distortion oscillator to reduce distortion even further, but will usually be limited to a few spot frequencies.
Even a tiny change of gain of an amplifier used in an oscillator circuit will cause the signal amplitude to increase until it distorts, or decrease until it dies away to nothing. The only way we can prevent either of these from happening is to provide an amplifier with more gain than is needed, and use automatic gain control (or controlled clipping) to maintain the effective gain at exactly the right amount to keep the sinewave amplitude stable. This isn't as easy as it might sound.
Many of the latest and greatest oscillators use DDS - direct digital synthesis, but such units are usually quite expensive. There are some very cheap ones, but they are not suitable for serious measurements. Even a 12-bit output is barely acceptable, as this will cause the minimum distortion to be around 0.04% - not bad, but certainly not very impressive. Lower resolution means higher distortion - 8 bit resolution gives a theoretical 0.5% THD with basic sample-rate filtering, and anything less than 8 bits is obviously pointless. While this can be improved with more advanced filtering, this increases complexity. For a usable system, I would not be happy with anything less than 14 bits, and preferably 20 bits or more. Needless to say, the digital clock frequency needs to be far greater than the highest output frequency. Distortion of a digitally generated sinewave with only sample-rate filtering falls by 6dB for each additional bit (the distortion is halved), so if we start from 7 bits (1%), 8 bits is 0.5%, 10 bits is 0.125%, etc.
Unlike a digital audio format, very steep low pass filters (to remove the switching waveform) usually cannot be used with test equipment. This isn't because the filters are audible or create problems as such, but because the filters need to track the audio signal across the wide frequency range generally available - typically from less than 0.1Hz up to 5MHz or more. Tracking filters expected to cover that range are not easy to implement.
The performance of test equipment should generally be at least 5-10 times better than the device under test ('DUT'). If this is not the case, you can't measure the response of an amplifier accurately if its response approaches that of the measurement system (both input and output devices). Needless to say, measuring an amplifier's distortion using a source that has perhaps 5 to 10 times more distortion than the amplifier is a completely pointless exercise. Even if the distortion is the same for the source and the DUT, the reading you obtain is obviously inaccurate and cannot be used meaningfully. This is a constant problem with most workshop systems - even those that are comparatively advanced.
The photo below shows an R35 made by ITT. There is no real consensus on whether these are R53 or RA53, but the writing on the glass says R53, so I suppose that is fair indication that this device is an R53. I've also used the RA53, and as far as I can recall, there's no apparent difference. Most people have never even seen one, so I have remedied this by including the photo. I actually had to enhance the bead itself a little, because it's so small that it didn't show in the photo. The glass envelope is evacuated (i.e. a vacuum), and there is a getter at the end (note the silvered tip). The bead itself is tiny - apparently it's about 0.2mm in diameter, and it's suspended on very fine (platinum?) wires. The idea is that it is self-heating, and is relatively immune from ambient air temperature.
Figure 1 - Photo Of R53 Thermistor
Provided the tiny bead runs hot enough (perhaps 60°C or so), variations in ambient temperature will have little effect on the resistance of the bead. The whole idea is that its temperature is determined by the voltage across it. With a thermal time constant of about 1 second or so, the resistance doesn't change much with the applied AC waveform itself, only the RMS current through the bead is important.
Despite this, the R53 and similar thermistors (and lamps) will show increased distortion at low frequencies. Fortunately, this is rarely a problem, and few people bother to measure amplifier distortion below 100Hz or so. A low frequency, low distortion source can be useful to measure the distortion from electrolytic caps as their reactance becomes significant compared to circuit impedance, but the audibility of distortion is very low at low frequencies anyway, provided it's no more than a couple of percent (and low-order).
While there are many small bead type thermistors, this particular style in the vacuum tube is no longer made by anyone. People are constantly asking for assistance to find one (as a search will reveal), but no major supplier sells them any more. I accept that the market must be pretty small so they would be fairly expensive, but I am baffled as to why absolutely no-one seems to make a thermistor designed to stabilise audio oscillators. There is still a significant market for basic test equipment, and the audio oscillator is one of the most important. An entire enterprise (Hewlett Packard) started with a couple of blokes building audio oscillators in a garage - perhaps it's time to try that again. Chinese made audio oscillators are readily available from many sources, but I don't know what they use for stabilisation (although I know that some use small lamps).
Even lamps are starting to disappear, because panel indicators and (analogue) meter scale illumination are done with LEDs now. As long as the market still exists for small lamps there shouldn't be any real difficulty, but no-one knows how long there will be a demand. Once usage falls significantly, the cost of making them increases dramatically, limiting options even further.
When we speak of audio oscillators, the primary waveform is a sinewave. Having access to a squarewave is useful, but the sinewave is favoured for the vast majority of tests. If we wish to measure distortion, then the sinewave needs to be exceptionally pure, with a THD that is substantially lower than that of the device under test. While less than 0.01% THD is desirable, it is extremely difficult to achieve with any variable frequency oscillator. Obtaining very low distortion is comparatively easy for a single frequency tone generator, but these are not common because few people can afford the space or cost of a dedicated oscillator that can't also be used for general purpose tests.
Most oscillators are simply an amplifier, with a tuned circuit (frequency selective filter) of some kind to set the frequency. In order to oscillate, it requires positive feedback. The amount of positive feedback needed is determined by many factors, including the losses through the selective filter. It is the filter that determines the frequency, and it can be either an all-pass (phase shift) or band-pass type. Band-pass filter based oscillators have a theoretical advantage, in that any distortion created by the amplitude stabilisation network is subjected to the action of the filter, so in theory distortion should be lower. In reality, this is not necessarily the case.
In the tests I did for this article, I found that the filter doesn't make as much difference as one might expect. Even though the Wien bridge (the most commonly used audio oscillator topology of all) has only very basic filtering, it still has amongst the lowest distortion of any of the different types. The Wien bridge is common for a number of reasons, not least being that it has good frequency stability, is a simple circuit, and is easily tuned over a one decade (10:1) range. The general schematic of a more or less typical Wien bridge oscillator (one of the most common types) is shown below. We will then dissect the various parts so that operation is easily understood.
As will be shown later, there are many different schemes for oscillators. Some are good, and others less so. For acceptable distortion, very few diode or zener stabilised oscillators are suitable, however there is one exception that will also be discussed. Almost any clipping stabilisation scheme can be replaced with a thermistor (best), an LED/LDR opto coupler (good) or a junction FET (varies from useless to good). Unfortunately, as we have already seen, thermistors that are usable for this application are virtually impossible to obtain. Occasionally R53/RA53 thermistors appear on on-line auction sites, but these are a rather unreliable source at the best of times.
Any waveform can be converted into a sinewave if you apply enough filtering, but unless the filter is part of the oscillator it is difficult to impossible to make the filter and oscillator track perfectly. High Q filters that will remove the harmonics effectively require an amplifier with a very wide bandwidth. As always, some of the designs shown below are simply interesting - they may not be used by anyone reading this, but every circuit you see has something to contribute to the world of analogue electronics.
Many oscillators are non-linear (function generators for example), and use waveform shaping to approximate a sinewave. While this is useful because there is no variation in level as the frequency is changed, distortion is usually too high to be useful. Anything above 0.5% is getting to the point where it's not useful for anything but frequency sweeps. Digital generators are not actually oscillators at all. The selected waveform is generated as a digital signal, and is converted to analogue using a digital-to-analogue converter (DAC). While many of the latest digital units are very impressive, they are also fairly expensive ($500 or more) and are difficult to justify for routine audio work.
While most of the other oscillator types will be lumped together, the Wien bridge has a special place in history, and is one of the most common audio oscillator configurations known. Since Bill Hewlett and Dave Packard started making them commercially in the late 1930s, total Wien bridge audio oscillator production would be in the hundreds of millions. There are very good reasons for this too. The amplifier only needs a modest amount of gain (3, or about 10dB), and the bandwidth only needs to extend to a little more than the maximum frequency expected.
Figure 2 - The 'Classic' Wien Bridge Oscillator
R2 (marked *) needs to be changed to suit the lamp's resistance. The lamp must be a low current type, and even so will cause some pain for most opamps. Opamps are not designed to provide more than a few milliamps during normal operation, but the lamp may require 20mA or more before its resistance rises enough to be useful. See below for a detailed explanation of how the stabilisation process actually works.
The Wien bridge itself is a phase shift network and a very basic (low Q) filter. At the critical frequency, there is a 0° phase shift, so there is positive feedback to the non-inverting input of the amplifier (in this case, an opamp). Figure 3 shows the general scheme of the Wien bridge, including the amplitude and phase response. You can see the basic filter response too. The upper capacitor causes the low frequency rolloff, and the lower cap causes the high frequency rolloff. The resistors (one in series, one in parallel) set the frequency - in this case 1.59kHz. This is calculated from the values of R and C (which must be identical for R1, R2 and C1, C2). Frequency is determined from ...
f = 1 / ( 2 * π * R * C )
f = 1 / ( 2 * π * 10k * 10nF ) = 1.59kHz
Many early Wien bridge oscillators used a variable capacitor rather than a pot. While this idea has great merit (variable capacitors will last several human lifetimes), it also means that all tuning circuit impedances are extremely high. Variable caps are very limited, and may have a maximum of perhaps 500pF. If you need to get to 20Hz, this means that the resistors need to be 15.9M for the lowest frequency range. Even a small amount of stray capacitance causes errors, and very complex shielding is needed to prevent hum and noise being picked up by the high impedance circuitry.
Figure 3 - The Wien Bridge And Response Curves
Figure 3 shows the Wien bridge itself, along with the frequency and phase response curves. As you can see, the amplitude is about 10dB down at the peak (exactly one third of the input voltage), so the amplifier must have a gain of 3 to ensure oscillation. In reality, the gain must be greater, or the oscillator will refuse to start or will stop. Unfortunately, the gain requirement changes very slightly due to small resistor (or pot) differences, but if it's only a tiny bit higher than needed, the amplitude will keep increasing until the output stage clips. Distortion is unacceptable at this point. This is why some form of amplitude stabilisation is essential.
With 1V input, the output of the Wien bridge is ideally 333.33mV - exactly one third. Even a very small variation between resistors and capacitors will change this though - a variation of ±1 ohm for the 10k resistors (0.01%) will change the gain requirements of the amplifier. The change is small, but it's enough to cause the oscillator to either stop, or increase level until it distorts the output. It may come as a surprise that a small incandescent lamp could possibly be accurate enough to allow the circuit to function in a useful manner.
The lamp is positioned in the negative feedback path around the opamp, and when cold will have a low resistance (all metal filament lamps have a positive temperature coefficient of resistance). This means that the amplifier will have very little negative feedback, so will oscillate immediately. As the output level of the opamp increases, more voltage appears across the lamp, its current increases, and so does its resistance. As the resistance of the lamp goes up, the opamp gain is reduced at the same time. A lamp is a PTC thermistor.
Within a relatively short period, the whole system reaches a state of equilibrium. Any attempt by the circuit to increase the output will result in greater lamp current, more negative feedback, so the level is prevented from increasing. In reality, it will increase, but hopefully only by a small amount. Likewise, should the level fall for any reason, current through the lamp filament falls, it cools a little, resistance falls, so gain is increased. Nearly all lamp or thermistor stabilised Wien bridge oscillators will show a variation of output level as the frequency is changed, so the stabilisation is definitely not perfect.
Figure 4 - Wien Bridge Oscillator Using Thermistor
A thermistor stabilised oscillator is shown above. Note that the thermistor and R2 have swapped places, because the thermistor has a negative temperature coefficient of resistance (NTC). As the level increases, more current flows through the thermistor, its resistance falls and this applies more feedback. Additional negative feedback reduces the gain and therefore brings the output level back to the desired voltage.
Most people who have used audio oscillators will have found that the level bounces after the frequency is changed. A level change is caused by imperfect tracking of the frequency pot, and the bounce is caused by the lamp (or thermistor or other stabilisation technique) time constant. It always takes a while until the level settles to the normal value, because it is extremely difficult to obtain critical damping. In extreme cases, the bouncing amplitude can continue for some time - especially at very low frequencies. There is an inevitable trade-off that must be faced with all amplitude stabilisation circuits ... use a fast acting system that settles quickly but has high distortion at low frequencies, or a slow acting system that bounces for some time, but gives good performance at low frequencies.
In some (up-market) oscillators, different time constants are used depending on the frequency. This is hard to achieve if the time constant is dictated by a thermistor though - it is what it is, and it can't be changed. Electronic stabiliser circuits become even more problematical because of the increasing complexity of the overall solution. If the time constant is wrong, the oscillator may just operate in short bursts followed by silence. While this type of waveform can be useful, a poorly chosen time constant for the feedback stabilisation is not the way to achieve the desired result.
An alternative to the traditional Wien bridge shown above splits the amplification into two parts. The parallel section is used in an integrator circuit rather than as a passive network. Feedback is applied via the series network as shown below. This modification to the conventional Wien bridge network is claimed (by J.L. Linsley-Hood) to improve performance and reduce distortion caused by "common mode defects" in the active device(s).
Figure 5 - Wien Bridge Oscillator With Two Amplifiers
A traditional Wien bridge as shown in Figure 4 has a significant common mode voltage (i.e. the signal voltage applied to both of the opamp's inputs), but in reality this is not usually a problem with modern devices. The stabilisation network (lamp, thermistor, etc.) will invariably cause far more distortion than any modern opamp.
Distortion is reduced if the output is taken from the output of the integrator (U1A) because it acts as a low pass filter, so removes some of the harmonics. Because of the way the feedback network and integrator stage operate, the second stage operates with a gain of two for stable oscillation. Diode stabilisation is possible, but requires several circuit changes and will give unacceptably high distortion. Lamp stabilisation should also be possible, with the lamp placed between U1A and U1B in place of R3, and the feedback resistor around U1B altered to suit.
For the time being, we'll assume a lamp for stabilisation, especially since no-one can get RA53 thermistors any more. The lamp's resistance at 25°C needs to be known, and a reasonable approximation of the current needed can be determined. The current will be enough to raise the lamp filament resistance so that it is well above ambient temperature, but not hot enough to glow visibly. Based on a number of fairly typical circuits available in application notes and elsewhere, a lamp filament current of around 7-12mA seems fairly common, which makes the lamp's warm resistance somewhere between 90 and 300 ohms. Look at Figure 2, and note that the feedback resistor is 470 ohms. For a gain of 3 as required, the lamp's filament resistance must be 235 ohms, and the opamp must be able to provide sufficient voltage swing and current to supply the feedback circuit's total resistance (705 ohms). If you can't see where I got the numbers from, I suggest that you read the beginners' guides for opamps and opamp circuits. Most of this is nothing more than Ohm's law.
I tested a likely looking miniature lamp (no, not the one pictured). For some reason, the US based IC manufacturers who publish the application notes all seem to think that everyone not only knows what a #327 lamp is, but can get one easily. Application notes refer to this mysterious 327 lamp as if it were some kind of (minor) holy grail.
Yes, it seems to be readily available in the US, but elsewhere? It transpires that the #327 is a 28V lamp, rated at 40mA or thereabouts (1.12W on that basis). At full temperature, the filament will have a resistance of 700 ohms. A photo of a #327 lamp is shown to the left, so for those of us not in the US, at least we know what it looks like. (Ok, I do admit that these lamps can be obtained outside the US, but they are not readily available.) The application notes generally fail to state that many different types of lamps can be used, and they provide no details to make it easier for the constructor to choose something suitable.
RS Components has a 28V, 40mA lamp (catalogue number 655-9621) that I believe works well. There actually quite a few lamps that can be used, so it should be easy to find one that works. At least until these small lamps become unavailable ! Unfortunately, no-one knows when that will happen, and maybe (if we're lucky) they will be with us for a few more years.
Miniature 12-24V lamps with a rating of 1W or less should be alright for most applications. Cold resistance should be as high as possible - aim for no less than about 25 ohms if possible. Some testing will be necessary, because it's irksome to try to calculate the lamp's resistance at all possible operating conditions. Lamps with a rated voltage below 12V probably will not work, because they require more current than most opamps can supply.
The miniature wedge bulb I used has a cold resistance of 28 ohms, but even the ohm-meter supplied enough current to raise the resistance to 32 ohms. I used a 200 ohm feedback resistor, and the opamp output voltage was 2.85V. I measured 945mV across the lamp, and total feedback current is 9.525mA - this means that the lamp's resistance must be 99.2 ohms. Allowing for resistor tolerance (I didn't bother measuring the exact resistance) this all looks about right. It is also possible to use the resistance change to calculate temperature, but tungsten makes this task somewhat more difficult than more sensible metals, because the tempco changes above ~100°C. However, as an approximation, tungsten increases its resistance by 0.0045% per °C. If we know that the resistance went from 28 ohms to 99 ohms, then this would indicate that the temperature of the tungsten has risen by 565°C, from 25°C to 590°C. This is so far above ambient temperature that normal variations cannot cause significant level changes.
|R = R0 ( 1 + α ΔT )||Where R is final resistance, R0 is res. at ambient, α is the tempco of res. and ΔT is the temp change in °C, or ...|
|T = T0 + ΔR / ( α * R0 )||Where T0 is ambient, T is final temp (°C), ΔR is resistance change and R0 is initial resistance at ambient.|
Measured distortion with the lamp I had was 0.04% at 150Hz and with an output voltage of 2.85V RMS. Not a wonderful result, but more than acceptable for most general purpose applications. Somewhat surprisingly, the measured distortion with the lamp was slightly lower than with an RA53 thermistor. The latter showed just under 0.05%, and both were measured at 150Hz. The distortion residual (just the harmonics after the fundamental has been removed by the distortion meter) was fairly smooth in both cases, although there was some noise. The circuits were tested on my opamp test board, and there was no shielding of any kind. I used 4558 opamps, which are roughly equivalent to the TL072, but have BJT inputs rather than FETs.
There are actually relatively few sinewave oscillator topologies around. Given the long-term popularity of sinewaves, one would expect a plethora of different designs, but this is not the case. Certainly, there are more options for fixed frequency oscillators (such as phase-shift oscillators for example), but variable frequency is expected by most users so the options become much more limited. Those shown here are representative only, and I have chosen to use a junction FET as the stabilising element for several examples. In each case, this is driven by a full-wave rectifier.
Stabilisation is the bane of all sinewave oscillators, because it either works quickly but with high distortion, or works slowly so has low distortion, but causes amplitude bounce when frequency is changed. Junction FETs are convenient but have relatively high distortion unless the level is kept very low (preferably under 100mV). LED/LDR opto-couplers would seem to be a perfect choice, and if used appropriately can give low distortion. Thermistors and lamps have better linearity than FETs or LDRs, so will win every time.
When a FET is used, it is a well known phenomenon that distortion is minimised if the gate has exactly half the AC signal level at the drain. Second harmonic distortion is virtually eliminated, leaving predominantly third harmonics at a greatly reduced level. Interestingly, most of the application notes that use electronic stabilisation only show half-wave rectification. A full-wave rectifier is preferable, as it reduces the ripple voltage in the stabilisation loop which helps reduce distortion.
The first of the alternatives is based on a state-variable filter, and although fairly complex, it performs well. The biggest advantage is that the sweep range can be made fairly wide - up to 100:1 is possible, although this can only be achieved realistically if a close tolerance dual pot is used for tuning. Distortion performance is acceptable, but is limited by the FET. Although I haven't tested this design with a thermistor in place of R6, I'd expect performance to be quite good. This design also has a cosine wave available from the output of U1B. A cosine wave is a sinewave, but displaced by 90°. The usefulness of this is dubious at best, although there are a few very specialised applications where a cosine waveform is needed. Few (if any) audio hobbyists will ever require a cosine output. It doesn't matter which output is used if you only require a sinewave, but the second integrator (cosine output, U2A) gives a slightly lower distortion.
Figure 6 - Sine-Cosine Generator Using State Variable Filter
This is an interesting circuit, partly because I could find no definitive origin. Parts of it are shown in an Intersil application note, and there are several sites that either show exactly the same circuit as indicated in the references, or have a link to the page. Distortion performance depends almost entirely on the FET used. I've shown a 2N5484, and while these were common, it's possibly one of the worst FETs around for this application. The original showed a 2SK30A, but it is a discontinued device and therefore will be difficult to obtain. The resistor in parallel with the FET (R7) needs to be selected for reliable starting and lowest distortion (it's therefore a compromise). The available range of JFETs has diminished greatly in the last few years, and good candidates are now harder to find.
R8 and R9 combine to ensure that the gate has exactly half of the signal present at the drain, and this reduces distortion (simulated) from 0.2% to 0.009%. The extra time constant created by R8, R9 and C3 causes some signal bounce, but it's well within normal expectations. Without the extra network, settling time is almost instant, but as noted above, distortion is increased. I have found it wise to use simulator distortion figures as a guide only, so expect the figures above to be somewhat higher than the simulator claims.
Frequency is determined using exactly the same formula as the Wien bridge. In the example shown it has the same frequency range as the Wien bridge above.
Figure 7 - State Variable Filter Oscillator With Diode Stabilisation
Another variant of the state variable filter oscillator is shown above. This uses diode stabilisation and distortion cancellation (R9 and R10). This is an especially interesting circuit, since it is easily capable of respectably low distortion, while still using simple and cheap diodes for amplitude control. The distortion cancellation shown can be applied for the Figure 6 circuit as well, although the resistor values will need trimming to get optimum performance. R8 (1k) is selected for reliable oscillation, and can be increased to reduce distortion, but the oscillator may not start if the value is too high. The two diodes must be accurately matched for forward voltage at a current of around 0.5mA to ensure waveform symmetry and minimum distortion.
Distortion cancellation relies on the primary distortion component being third harmonic, and this will always be the case when matched diodes, thermistors or lamps are used for amplitude control. Distortion components cannot be accurately predicted if LED/LDR optocouplers or FETs are used. The circuit as shown has a fairly high output impedance, so must be followed by a buffer stage.
The state variable filter based oscillator shown above is also known as a quadrature oscillator, because it produces two sinewaves in quadrature - they are exactly 90° apart. One sinewave is available from U2A as shown, and another can be taken from U1B.
Another version of the same basic arrangement is shown in Figure 8, and this too is a quadrature oscillator. It's not a particularly user-friendly oscillator though, because there are three time constants that must be changed for tuning. All three must be identical, and the oscillation frequency is given by the normal formula.
Figure 8 - Quadrature Oscillator Using Three Integrators
The lowest distortion is obtained from the non-inverting input of U1B, but this is high impedance so would need to be buffered with a FET input opamp. The amplitude stability depends on the saturation voltage of the opamps, and residual distortion is generally hard to remove. It is also very difficult to predict because it will often be dependent on the opamps used. In general, THD below 1% is probably optimistic.
There are a number of variations on this theme, but this particular version is interesting in that it only requires one resistor value to be changed to change frequency. A single-gang pot eliminates any issues with tracking, and this problem is actually worse than expected. Few (affordable) pots offer good tracking between sections, and this circuit solves the problem by not needing a dual-gang pot.
Apart from anything else, the filter section itself is mildly interesting. If you look at the various active bandpass filters, you will see that this is really a multiple feedback bandpass filter, No-one seems to bother mentioning this, yet it surfaces in several application notes and on a number of websites. National Semiconductor refer to it as an "easily tuned" oscillator, which is certainly true enough. Stabilisation is achieved using clipping diodes, but a thermistor, FET or LED/LDR can also be used with appropriate circuit changes. Distortion can be very low if a linear stabilisation technique is used, but even with diodes can be under 1%.
Figure 9 - Oscillating Bandpass Filter Oscillator
There are two major disadvantages of this circuit that are not mentioned in any of the application notes I've come across. High frequency performance is very limited, because the filter stage (around U1B) operates with considerable gain. As the frequency is increased, the tuning resistance (R2 + VR1) is reduced to the minimum, and this attenuates the signal from the diode clipper. With the values shown and at maximum frequency, the opamp needs a gain of at least 30, and preferably a lot more. Very fast opamps could be used, but they are expensive and in my opinion are wasted on this circuit. One common example on the Net shows VR1 as 1k and R2 as 51 ohms. The opamp is operated at high gain to get a high Q (which minimises distortion), and this limits the maximum usable frequency.
The other problem is that the tuning range is comparatively small. To maintain acceptably low distortion, the tuning ratio is only about 4:1 - rather inconvenient and much lower than that from other topologies. Distortion is inversely proportional to frequency, so at the minimum frequency the THD will be roughly 4 times that of the maximum frequency. These two issues confine the circuit to the "interesting but not very useful" basket. This is contradictory to some of the claims you may see for this circuit, but I've built and tested one so I know its limitations. With the pot at minimum, the operating frequency is approximately equal to ...
f = 1 / ( 2 * π * C * √R1 * ( R2 + VR1 ) )
f = 1 / ( 2 * π * 10nF * √560 * 470k ) = 981Hz
The most (potentially) useful part of this design is the filter. While it's simply an adaptation of a MFB bandpass filter, using it as a variable tuned filter is unusual. The Q varies with the pot setting (high resistance gives a low Q), but in many cases this is not a major limitation.
This is a very uncommon circuit, and is one that I happened to find in a commercial product. Although it is single frequency, it's a potentially interesting circuit because it is capable of fairly low distortion, despite the use of zener diodes for amplitude control. It typically has a higher output than many of the other circuits, and as shown below produces about 5V RMS output level with a distortion of as little as 0.04% (with considerable tweaking!).
Figure 10 - Low-Pass Filter + Integrator
Although the circuit is not complex, amplitude stability with changes in both supply voltage and temperature are quite good, but tuning is difficult. With the values shown it oscillates at about 1kHz, but no resistor value can be changed that affects only the tuning and not amplitude. This makes it suitable for fixed frequencies only. The value of R3 is quite critical - it needs to be low enough to ensure reliable oscillation, but not so low that the output distorts. The circuit gain around the integrator is almost exactly 2 (6dB). The voltage losses in the filter and zener clipping circuit need to be exactly replaced by the integrator gain to maintain oscillation.
As mentioned - interesting, but only marginally useful. Determining the frequency is rather irksome, and can only be approximated. In theory, the frequency for the circuit as shown is 1026Hz - roughly based on the standard formula ...
f = 1 / ( 2 * π * C1 * R1 )
This is also influenced by the integrator (U1B) time constant determined by R3 and C3, and this makes it considerably less predictable. When simulated, the circuit oscillates at 1016Hz, but a test circuit oscillates at about 970Hz. This is outside the expected variation based on typical component tolerances. Although the circuit is (surprisingly) quite stable in operation, virtually every component changes the amplitude and frequency. The only exception is the zener diodes which may be changed with only minor effect, but even R4 changes both amplitude and frequency!
Of the alternatives, this is by far the best I've found. For most applications will easily beat almost anything else. It is described in Project 86, and has very good performance. The only down-side is that the dual-gang pot needs to track fairly accurately to prevent drop-outs (bounce is virtually non-existent), but it's much better than a Wien bridge oscillator in that respect. In addition, PCBs are available from ESP - see the pricelist.
Because of the 'feedforward' distortion cancellation signals, the output can achieve a distortion as low as 0.1% with diode clipping. A thermistor can be used instead of diodes to reduce the distortion even further, but the problem of obtaining thermistors remains (of course). There is no reason that an LED/LDR solution wouldn't work equally well, although this has not been tried. Unlike most of the alternatives, this oscillator can have a much wider frequency range than expected - up to 25:1. This means that the entire audio band is more than adequately covered by only 3 ranges ...
10 - 140 Hz
140 - 1,960 Hz
1,960 Hz - 27.44 kHz *
To be able to get beyond 20kHz requires fast opamps, and is usually not needed for the majority of tests. A more realistic upper limit is around 15kHz, and a reduced frequency range (such as 14:1 as shown above) allows more accurate frequency adjustment. The minimum frequency is limited only by the amount of capacitance you can use for CT (timing capacitors) and RT (timing resistor + pot). There is no theoretical lower limit for frequency, and if the diode limiter is used (rather than a thermistor or electronic stabilisation scheme) distortion will remain low at well below 1Hz. Frequency calculation uses the same formula as the Wien bridge.
Please note that the term 'feedforward' is not strictly correct in the context used here, but it does convey the principle fairly well. Also, much like the state-variable filter based oscillator, I found little information on the Net about this circuit, except for the contributed project published on my site. It is based on a circuit described in the February 1982 issue of Wireless World (now Electronics World), contributed by Roger Rosens. The original relied on a long obsolete NTC thermistor for amplitude stabilisation.
Figure 11 - Phase Shift + Distortion Cancellation Oscillator
The secret of how this design achieves such low distortion from a diode limiter and no filtering lies in the final opamp. In much the same way as the diode shaper shown below sums the various outputs to approximate a sinewave, the final stage sums signals with a defined phase displacement. The result is almost complete cancellation of third harmonic distortion, along with a worthwhile reduction of fifth and seventh harmonics as well.
Overall, this is probably the most useful of all the different types shown, however it does use more opamps than most, and will use even more if electronic stabilisation is added. Because of the multiple summing points that give this circuit its low distortion, a lamp cannot be used, so amplitude limiting will be via the diodes as shown, or an RA53 thermistor if you can get one.
This general class of circuit is simple to build if you need a simple oscillator in a hurry. They don't require stabilisation (although it can be applied with some effort), and are very common circuits. Traditionally used in valve guitar amps as the tremolo/ vibrato oscillator, there are probably many millions of them around. The frequency formula is not especially accurate, and although frequency can be changed by around 5:1, the amplitude usually changes too. Any timing resistor can be changed to change the frequency, and for a limited range (~4:1), R3 can be varied with only small amplitude changes.
Although shown with feedback using R4 and R5, the opamp can be operated open-loop (maximum possible gain) by omitting R5 and shorting R4. Output level will be higher, oscillation is absolutely guaranteed (as long as it's within the opamp's range of course), but distortion is greater and frequency stability isn't as good.
Figure 12 - Phase Shift Oscillator
With the values shown, the frequency is 1.73kHz, with 0.4% distortion (only odd harmonics). Output voltage is 370mV with ±15V supplies. Traditional frequency calculation isn't possible, because each RC network is loaded by the one following. That means that more gain is needed from the opamp, and the phase shift network interactions make straightforward calculations difficult. If the gain of the amplifier stage is reduced with feedback, there must be sufficient gain to ensure that oscillation is reliable. The amount of gain needed is normally around 30, but is increased if the three RC networks are not identical.
fo = √6 / (2 * π * R * C) = 1.77kHz (This is approximate, and only works when all values of R and C are equal)
If R3 is increased to 33k, the frequency decreases to about 1.2kHz. However, you'll need to increase the value of R5 to get more gain or the circuit won't oscillate. This is a useful circuit, but it has limited application. For wider frequency range adjustment, all three resistors can be changed and this will keep the amplitude the same. Triple-gang pots are as common as R53 thermistors, so this is not really a viable option. A dual-gang pot could be used in series with R2 and R3, which will increase the frequency range. Output level will vary with frequency though. Note too that the output is at a high impedance, and must be buffered to prevent the external load from affecting the frequency. The signal at the output pin of the opamp has the highest distortion, so isn't generally very useful.
Figure 12A - Transistor Based Phase Shift Oscillator
You will see this circuit used with the resistors and capacitors interchanged as shown above. This method of wiring the phase shift networks is actually necessary for single transistor, FET or valve circuits, but it is not correct if the gain stage is an opamp. Note that the output is from the transistor's collector, and distortion is fairly high because the RC networks can't filter out the harmonics. The frequency isn't particularly stable, and a simulator indicates that the above circuit oscillates at 380Hz. This may not be expected, as one would think it should run at the same frequency as the opamp version because the RC networks use the same values. The change to the feedback path affects the way the circuit works, and in this circuit, every component affects the frequency.
While an opamp will certainly oscillate when connected the same way, this arrangement provides poor frequency stability and high distortion, so its output is a very low quality 'sinewave'. As an alternative circuit using opamps it's completely pointless and I suggest that you don't bother. It's just a carry-over from the single valve and transistor circuits as shown above, but it makes no sense to wire an opamp phase shift oscillator this way.
More advanced versions of the same principle also exist, and may even be given exotic (or stupid) names (such as 'Bubba' oscillator). It doesn't matter what you call it, it's still a phase shift oscillator. Although traditionally phase shift oscillators have used 3 sections, more can be added - the 'Bubba' oscillator uses 4 phase shift networks. Extra sections give the opportunity for lower distortion, but at the expense of overall parts count. Because of the buffers, the output can be loaded by an external impedance without affecting frequency. Buffer stages reduce voltage losses, but add complexity and cost.
Figure 12B - Buffered Phase Shift Oscillator
Adding the buffers to a standard phase shift oscillator means that each RC network acts independently. Using 3 opamps as shown above means that the RC networks are truly independent of each other, although the final RC network (R3, C3) is loaded by the feedback resistance. Provided the resistances are high enough, loading is minimal. The gain opamp (U1A) should be used with feedback as shown, or the circuit will have excessive distortion. Each RC network contributes 60° of phase shift, providing 180° in total. Oscillation frequency is 1.26kHz in a simulation, and this circuit requires a gain of at least 8 for sustained oscillation. Frequency is approximately ...
fo = √3 / ( 2 * π * R * C ) = 1.25kHz for the values shown
I have no idea where the name came from, but the Bubba (ok, I'll drop the quotes ) is actually a useful design for fixed frequencies. Apart from fairly low distortion, it appears to have good frequency stability, which may be critical for some applications. The lowest distortion is from the junction of R4 and C4, but that requires yet another buffer so the load doesn't change the frequency and amplitude. Taking the output from the point shown is a reasonable compromise, and will give a sinewave with under 0.5% distortion.
Figure 12C - Bubba Phase Shift Oscillator
Adding a fourth phase shift network means that each RC network only contributes 45° phase shift, and this is claimed to improve the frequency stability. This is not a circuit that I've built and tested, but extensive simulations confirm that it performs as expected. Oscillation frequency with the values shown is 720Hz, and the Bubba circuit requires a gain of at least 4 for sustained oscillation. Frequency is approximately ...
fo = 1 / ( 2 * π * R * C ) = 723Hz for the values shown
While it looks relatively complex, it's just repetition, and the cost is fairly low - especially if a quad opamp is used. For maximum frequency and amplitude stability, the opamps used should be FET input (for the high impedance) and rail-to-rail output so that output device saturation voltage has no effect. There are many suitable opamps, and CMOS types should be well suited to any of the phase shift oscillator designs.
A technique that was popular some time ago was the BFO. Two high frequency oscillators were used, generally operating at several hundred kHz or more. The two signals were fed into an RF mixer, and the audio output was the difference frequency. For example, if one RF oscillator operates at 1,000,000Hz and the other at 1,000,100Hz, the difference frequency is 100Hz.
You may well ask why, and today no-one would bother. BFOs were used to generate sweep signals, and can easily cover from 20Hz to 20kHz in a single sweep. The change required for an RF oscillator is comparatively small in percentage terms (20kHz is only 2% of 1MHz), and was easily accommodated with the valve circuitry that was available at the time. Sweep signals are common today, and are primarily digitally derived as part of a testing suite for amplifiers, speakers, etc. There is still a need for stand-alone sweep generators, but it's far easier (and a great deal cheaper) to use a digital waveform generator or a PC based system, several of which can be obtained on-line as a free download. BFOs are interesting, but are largely a thing of the past.
This is another single frequency oscillator, and is included because it's referenced widely on the Net and you may find it useful as a quick project or just for experimentation.
There are many circuits that use a squarewave oscillator as the basis for generating a sinewave, and what's needed is a filter to remove the harmonics (3rd, 5th, 7th, etc.). Despite claims you might see, this is not terribly effective, and the output is a fairly rubbish version of a 'sinewave'. While tuning is theoretically simple, the filter has to be tuned too, and that makes it quite difficult because you'll need a triple-ganged pot (you can get them, but they are not common and fairly expensive). This means that it's not really a viable way to generate a very poor attempt at a variable frequency sinewave.
According to the literature [ 10 ], it's supposedly a worthwhile circuit, but a quick examination reveals many weaknesses. Firstly, the frequency depends on the voltage appearing across R1 and R2, and that depends on the saturation voltage of the opamp. Most opamps can get to within ~1.5V from each supply rail, but that changes with loading and temperature. In theory, the circuit is self-correcting, because both positive and negative feedback come from the output of U1A. In reality, the frequency stability is ok - not great, just ok.
Figure 13 - Squarewave Oscillator + Filter
With the values shown, the frequency is 467Hz, and the output level is 980mV RMS. The application note referenced claims that the filter section should be tuned to the same frequency as the oscillator, but distortion is woeful if you do that. Even with the filter shown (tuned to 239Hz), the distortion is still almost 4% - hardly a good result. However, you may find a need for a low cost oscillator, and this general arrangement works well enough.
Note that the formula shown in the application note doesn't work, so to change frequency you can scale the resistor values (R1, R4 and R5) to change frequency. I don't propose to work out a formula for the frequency - you'll just have to experiment (a simulator is good for basic testing). While it can be improved from the circuit shown, for the most part I'd suggest that it's not worth the effort. Many of the alternatives shown above will give better results, simpler (and more accurate) tuning, more predictable performance and for around the same cost.
The twin-t (aka twin tee) oscillator is something of an oddball in several respects. Rather than using a tuned bandpass filter, it uses a tuned band stop (notch) filter, and the opamp is operated with positive feedback via R1 and R2, with the notch filter in the negative feedback path. Less positive feedback (by making R2 a lower value) results in lower distortion. However, if there's not enough positive feedback the circuit won't oscillate reliably.
Figure 14 - Twin-T Oscillator
In my version shown, the twin-t circuit is deliberately slightly unbalanced, so the notch is not as deep as it would be if the values were exact. Perhaps surprisingly, this improves performance slightly. More importantly, it reduces component count (by two parts), making the circuit (ever so slightly) cheaper to build. Very little non-linearity is needed to stabilise the output, and a resistor can be used in series with D1 and D2. Adding as much as 47k barely changes the output level, but also has only a minor effect on distortion. As simulated, the distortion with the circuit exactly as shown is around 0.75%.
It works by ensuring that there is very little negative feedback at the tuned frequency, because of the twin-t notch filter. The frequency is determined by ...
f = 1 / ( 2 * π * Rt * Ct )
Normally, Rt/2 and 2Ct would consist of 2 x Rt in parallel and 2C would be 2 x Ct in parallel. While this theoretically should improve performance, there seems little to suggest that it makes a great deal of difference. The twin-t does not lend itself to easy tuning, so it's mainly useful as a single frequency oscillator. As shown, frequency is 1.03kHz. This is less than the calculated value because 2Ct and Rt/2 are not exactly right.
It's also fairly easy to make an oscillator using L/C (inductor/ capacitor) tuning, but it's not a viable option for audio. It was not uncommon many years ago in the valve era, but the inductor is large, heavy and will pick up magnetic fields at mains frequency. LC oscillators are best kept for radio frequency circuits, where the inductor can be physically small and air-cored. Because this approach is not suited to modern audio applications, LC oscillators are not covered here.
Since the ideal thermistor is effectively unobtainable and lamps require more current than we might have available, we need to look at alternative methods. I have already shown a FET used as a variable resistance, and these are convenient, cheap, and work well enough so long as the (AC) voltage across the FET is kept to a minimum. Providing an AC signal at the gate which is exactly half the voltage on the drain helps dramatically, and even harmonics (2nd, 4th, 6th, etc.) are effectively cancelled, leaving only the small odd harmonic residuals. This comes at a price though, because there are now two time constants - one based around each capacitor (C1 and C2) seen in diagram 'A' below.
Figure 15 - Electronic Stabilisation Examples
Adding this extra time constant can cause serious bounce, and in extreme cases, what's known as squegging. This refers to the behaviour of an (analogue) electronic circuit that appears to function normally for a period (typically a few milliseconds), then shuts down for a period (from milliseconds to seconds) before repeating the whole process. The design of control-loop time constants is almost a complete science in itself, and it is very easy to make a seemingly insignificant change that either causes or cures the problems. Needless to say, control-loop theory is outside the scope of this article, but during both physical testing and simulation of the circuits shown, I encountered squegging on several occasions. Multiple time constants that are reasonably close together will cause problems, so it is generally necessary to ensure that time constants are widely different if more than one is involved.
For this reason, the filter cap for the LED/LDR opto coupler feedback circuit is much smaller than it really should be. LEDs are extremely fast, but LDRs are relatively slow, with the VTL5C4 taking several seconds to return to maximum resistance after illumination. The experiments I performed showed that adding a filter cap of a useful value after the diodes caused squegging, and while I'm sure that there is a combination that would work, I simply left it out to prevent problems. However, this limits the low frequency range because distortion becomes very high at frequencies below ~50Hz or so (this depends on the specific opto coupler, as there are many different types with different response times).
There is one major difference between the way these two circuits work. The FET has minimum impedance with no signal, and increasing the signal level increases the FET's impedance. In this respect, it is the equivalent of using a lamp, so must be in the same electrical location that would otherwise use a lamp. For the Wien bridge, this means that the FET connects from the feedback node to ground.
The LED/LDR opto coupler is the equivalent of a thermistor as it has maximum resistance with no signal, and the resistance falls as the level increases. While the operation can be electrically reversed, doing so simply adds more parts for no real benefit. In both cases, it is important to minimise the voltage across the FET or LDR. Smaller voltages and/or currents mean lower distortion, so the variable resistance element should use series or parallel resistance (or a combination of both) to achieve the highest linearity.
Naturally, you must ensure that there is always enough available gain to ensure that oscillation starts reliably, and this influences the distortion null setting. While you may be able to get low distortion from the Distortion Null control, you may then find that the circuit refuses to oscillate at high frequencies or when the oscillator is first turned on. This means that some distortion performance must be sacrificed to ensure reliable oscillation under all conditions.
Another option is a LED/FET optocoupler, such as the Fairchild H11F1. I've not tried them, so can't comment based on direct experience. However, since the active element is a FET, we already know that the level has to be kept low to minimise distortion. The datasheet claims that low level AC and DC can be controlled "distortion free" (a quote from the datasheet), but I find this a little difficult to accept. Many posts on forum sites complain of high distortion with this (and similar) devices, so they are probably unsuitable for a low distortion oscillator gain control.
Although I've never seen it done, a high quality VCA (voltage controlled amplifier) such as the THAT2180 could be used for amplitude stabilisation. See Project 141 to get an idea of how these work. Distortion is very low, at a claimed 0.02% for the THAT2180B. Using one in an oscillator would be a challenge though, and I don't know how well it would work in practice.
Diode waveform shaping is very common with low cost analogue function generators (it's inside the IC itself in most cases), but the lowest distortion that is typically available is around 1%, although as low as 0.25% is claimed in some literature. The input signal is a triangle waveform, and the diodes progressively clip the peaks to give a reasonably smooth sinewave. Although the distortion is usually audible, it is still usable for simple signal sweeps, for example to find the resonant frequency of a speaker. There are countless different diode clipping schemes on the Net, and the one shown below is purely an example.
Triangle waveforms are very easy to generate with simple opamp circuits, and that makes it attractive for low-cost function generators.
Figure 16 - Waveform Shaping Example
In the example shown, a ±6.6V triangle wave input gives the lowest distortion. Because of the different impedances in each of the 4 clipping circuits, the output amplifier sums a variety of clipped and un-clipped waveforms, with the end result looking rather like a sinewave. It is very important that the triangle waveform is perfectly symmetrical, or distortion rises rapidly.
Another option is to use a logarithmic amplifier. While this is theoretically better than diode clipping, in reality there's usually very little difference between them. Unless proper temperature controlled log ICs are used there will usually be a small change in amplitude and distortion as the ambient temperature changes - this applies to diode shaping as well, although the effects are likely to be less severe with the simpler diode clipping circuits.
Digitally generated sinewaves are becoming much more common than they once were, but most have a limited bit depth which limits the usefulness of such techniques. I would suggest that anything less than 8 bits is completely useless, because distortion will be too high. Eight bit resolution gives a theoretical distortion of 0.5%, and this is halved for each additional bit used. Two techniques that reduce distortion are the addition of a filter (preferably tracking) to remove the harmonics, and adding dither - essentially random (white) noise - at a very low level. For serious work, nothing less than 14 bits is really much use, as distortion is still too high unless post-filtering and dithering is used. A 14 bit system should be able to provide distortion below 0.01%.
Figure 17 - Digital Sinewave Generation
The above is an example of a digitally generated sinewave. The output frequency is 1/10th of the input (clock) frequency. In the example shown it's limited to 5 bits, so while the theoretical distortion is 4%, this can only be achieved if the signal is filtered. More aggressive filtering will reduce the distortion. With a 220nF cap in parallel with R5, distortion is reduced to a little over 2%. This type of generator can only be used with a tracking filter as described in a Silicon Chip magazine article that had a design for a complete system. However, in the SC article, the values of R2 and R3 were wrong - they were specified as 16k, but this makes the distortion a great deal worse than it should be.
A viable option for digital since generation is to use the sound card in a PC. There are several freeware and shareware programs available on the Net that will generate sine, square and triangle waveforms. The distortion should be very low, but it depends on your sound card.
Throughout this article, I have used variable resistance (potentiometers) as the frequency control device, but these have known issues that limit their usefulness. While there are some very good quality wirewound pots that would be suitable for long-term reliable use, these are not commonly available with high values or in dual-gang configurations.
Commonly available (cheap) pots have poor tracking, and that increases amplitude bounce as the frequency is changed. As the pot wears, there will also be small "dead spots" caused by minute gaps in the contact area as it gradually wears away. Dust can also cause dead spots. Anything that disturbs the tracking causes the amplitude stabilisation network to work that much harder, and amplitude bounce is extremely annoying when carrying out many common tests.
One common fix for this is to use radio type tuning gangs - variable capacitors. Because the plates mesh together without ever touching, there is no wear, although bearings can fail if the instrument is heavily used. I have a number of pieces of test gear that use variable capacitors, and have never had a failure of any kind. Meanwhile, I have replaced pots several times in other equipment.
There is no doubt that the variable capacitor is by far a better control system, but it too has its problems. Most importantly, the capacitance is low, usually around 100-500pF. This means that circuit impedances are high - for 20Hz at 500pF, you need resistors of 15.9M ohms. Small amounts of stray capacitance cause major problems, and the likelihood of hum pickup is greatly increased.
In addition, all amplifiers used (whether discrete or opamp) must have FET inputs because of the very high impedances involved. However, nearly all of the circuits shown above can use a variable capacitor for tuning, and for different ranges the fixed tuning resistors are switched. Some more recent oscillators (Chinese origin) use variable caps that have higher than normal capacitance. This is achieved by using a plastic dielectric film between the plates, thus increasing the capacitance but at the expense of thermal stability.
Based on the information in this article, you should now be able to build yourself an audio sinewave generator. They are not simple, and obtaining vanishingly low distortion is a serious challenge for all techniques, both analogue and digital. The one component that made a low distortion oscillator a comparatively simple project - the RA53 thermistor - is now gone. Apart from a few old buggers like me who've managed to squirrel a couple away over the years, they are virtually unobtainable. Small lamps do work surprisingly well though, and this remains a viable option.
Although I have shown that the lamp will work, they are less predictable than the thermistor unless you have a reliable source. More complex techniques using FETs or LED/LDR optocouplers may often be needed, but most are unable to get distortion figures that even approach the thermistor or lamp. Eventually, all audio oscillators will probably be digital, because the analogue techniques are getting too hard. Even finding a good quality dual-gang pot with accurate tracking between the sections is difficult - once, high value wirewound pots were made that were perfect, but these too have all but vanished.
To be able to take distortion measurements, the easiest approach will almost always be to use a general purpose audio generator followed by a low-pass filter. This can be made switchable, so you can have a few spot frequencies for distortion measurements, but still have the ability to sweep the signal over a wide range. The filter will reduce the level of harmonics, and would normally be built so that the -3dB frequency of the filter corresponds to the measurement frequency or slightly below (amplitude will be reduced). For most applications, a 12dB/octave (second order) filter will be sufficient, and will reduce distortion by a significant amount. Naturally a higher order filter will reduce the distortion further. In a test that I ran, initial distortion was fairly high - almost 0.7%. A 12dB/octave filter reduced this to 0.2% and a 24dB filter reduced it further to 0.06%. Naturally, if you start with a distortion at an already sensible value (around 0.02% or so), a 24dB filter will get you to perhaps 0.002%.
Ultimately, you will quickly run out of distortion signal and be left only with noise. Even here, the filter helps a lot, because all noise above the test frequency is filtered out. With a much narrower bandwidth, noise is diminished significantly.
As I hope is now very clear, sinewaves are not simple. They are without doubt the hardest signal to generate accurately (i.e. with minimum possible distortion), and I hope the information presented gives you a few new ideas. Despite all the advances in electronics over the years since Hewlett-Packard started building Wien bridge audio oscillators in a converted garage, this still remains the best overall topology. To be able to get the wide range of frequencies needed for response measurements, we still need to use discrete circuits. Few (affordable) opamps have good enough high frequency response at full level - we need at least 100kHz, preferably more.
For what it's worth, the audio generator I use the most now is a digitally synthesised function generator, which includes sine, triangle and square waveforms, dual oscillators (which can be synchronised), tone burst facilities, a sweep generator, arbitrary waveform generation, plus a great deal more. It's very flexible, but it's also less convenient than a standard analogue oscillator for some applications. Residual distortion is 0.02%, so it's (just) good enough to be able to take distortion measurements on most equipment.
For most hobbyists, I would not recommend a digital function generator, as it's far more than is necessary for most testing and they aren't as convenient as a normal audio oscillator. I needed it because of work I've been doing that involves very low frequencies (0.1Hz or less in some cases), but that's obviously not needed for normal audio work. One design that is recommended is Project 86, which uses the technique described in Section 6.5 in this article. It's not perfect, but it does perform surprisingly well. As noted above, there's also a PCB available, which makes it easy to build.
1 - Thermistors, lamps, LED/LDR Stabilisation Techniques, Linear Technologies Application Note, AN43
2 - "Easily Tuned" oscillator - National Semi Linear Brief, LB-16, 1995
3 - Sine-Cosine Oscillator
4 - Intersil Application Note AN1087, March 20, 1998
5 - Sinewave Generation Techniques, National Semiconductor Application Note, AN-263, 1999
6 - Design of Opamp Sinewave Oscillators, Ron Mancini, Texas Instruments Application Note
7 - Wien Bridge - Classic circuit, multiple sources (including several above).
8 - Wien-Bridge Oscillator With Low Harmonic Distortion, J.L. Linsley-Hood, Wireless World, May 1981
9 - Sine Wave Oscillators, Ron Mancini and Richard Palmer
10 - A Quick Sine Wave Generator - SNOA839 - Texas Instruments
11 - Sine-Wave Oscillator SLOA060 - Texas Instruments
Designing With Opamps - Part 1 and Part 2 - ESP
|Copyright Notice. This article, including but not limited to all text and diagrams, is the intellectual property of Rod Elliott, and is Copyright © 2010. Reproduction or re-publication by any means whatsoever, whether electronic, mechanical or electro- mechanical, is strictly prohibited under International Copyright laws. The author (Rod Elliott) grants the reader the right to use this information for personal use only, and further allows that one (1) copy may be made for reference. Commercial use is prohibited without express written authorisation from Rod Elliott.|