# Types of Oscillator Circuits for Sinusoidal Wave Generation

*Here’s what you need to know about different types of oscillator circuits.*

Waveform generation is an important part of analog circuits as part of design and testing, interacting with sensors, RF and wireless applications, and generating clocks. The analog possibilities are simply endless when you use an arbitrary waveform generator. While most folks will just generate a square wave with a multivibrator circuit, you’ll need more complex circuitry to generate waveforms for more advanced applications. Here’s how you can easily generate the waveforms you need with some simple oscillator circuits.

## Fundamental Types of Oscillator Circuits: Square, Sine, and Triangle Waves

The fundamental waves produced by oscillator circuits are square, sine, and triangle (and the associated sawtooth) waves. These waveforms can be converted between each other using some simple circuits, usually involving one or more op-amps. This normally requires generating some initial wave and feeding it into a converter circuit, which then outputs the desired waveform.

The other option is to convert DC directly into an oscillating waveform. The classic way to generate a square wave from a DC signal is to use an astable multivibrator. This type of oscillating circuit is extremely easy to layout with some passives and two transistors, or you can wire up a 555 timer as an astable multivibrator. This circuit is shown in the image below. In this circuit, the transistors act as alternating switches that are triggered by the charging/discharging capacitors. The off-time for transistor Q2 is equal to 69.3% of the time constant of R1C1, and similarly for transistor Q1. If the time constants are equal (C1 = C2, and R1 = R2), you have a square wave with 50% duty cycle. This then allows you to control the duty cycle by using capacitors or resistors with different values. The slew rate in the output depends on the rise/fall time of the transistor.

*Astable multivibrator circuit for converting DC to a square wave output.*

If you’re working with a stream of clock pulses (i.e., using the filtered output from a crystal oscillator), you can convert the clock signal into a triangle or sawtooth wave using an integrator circuit. Similarly, you can convert back to a clock signal using a differentiator circuit. These circuits are basic enough to build from resistors, capacitor, and an op-amp. You can also take advantage of hysteresis in a comparator to produce a PWM signal from a triangle wave, where modulation can be controlled by changing the height of the triangle wave around some particular operating point.

Other types of oscillator circuits for direct generation or conversion include the Hartley, Armstrong, Clapp, Colpitts, and RC oscillators. These simple types of oscillator circuits involve an op-amp or some transistors, and some passive components, making them easy to implement in a PCB.

## Generating More Complicated Waveforms

Working with more complicated waveforms, such as arbitrary waveforms and modulated waves, requires working with different types of circuits. These waveforms are more specialized for different applications, but it is easy to create the required circuits for these waveforms with COTS components.

### FM and AM Waveforms

AM waveforms are effectively equivalent to the product of a high frequency carrier wave and a low frequency modulated wave with some DC offset. Adding a DC offset to a low frequency sine wave is simple with an analog adder circuit or some specialized sine wave generators. This can then be fed into an analog multiplier circuit along with the high frequency carrier wave, producing a high frequency carrier with a superimposed envelope. FM waveforms can be generated using a voltage-to-frequency converter, where sidebands are modulated by setting an input voltage level to the converter.

There is a wealth of modulation schemes used in telecom applications that are far beyond the scope of this article. In the meantime, let’s look at arbitrary waveform generation:

### Arbitrary Waveforms

The mathematically astute designer should know that an arbitrary repeating waveform can be generated by adding up an infinite number of sine and cosine waves with specific amplitudes. Obviously, feeding multiple sines and cosines into an infinite port adder is not possible. Adding up a smaller number of waves produces some error in the output waveform, so a more elegant solution is required to generate arbitrary waveforms.

This is where you can use a digital-to-analog converter (DAC) and a microcontroller in a simple circuit. The job of the microcontroller is to encode the signal level at successive portions of the arbitrary waveform as a digital number. This digital number is then sent to the DAC, which converts it to the corresponding analog signal level. In order to prevent the signal level from switching quickly between discrete levels as the output changes, you need to add some dithering to the output. This will produce a much smoother transition between discrete output signal levels. The AD9708 IC or a similar DAC with fast response time is ideal for this application.

*Quantized output from an arbitrary waveform generator with a DAC without smoothing. The desired exponential waveform is shown in blue.*

The drawback with this method is that the waveform’s frequency and accuracy in shape will be limited by the clock frequency of the microcontroller. The microcontroller will have some maximum frequency at which it can supply an output through GPIO or other interface; this limits the maximum signal repetition frequency to C/N, where C is the microcontroller’s clock frequency and N is the number of discrete levels used to encode the signal. If you need to go to higher frequencies, then you need a faster clock; a small FPGA that runs at high clock speed is a good alternative as it will be dedicated to producing a specific waveform.

Building different types of oscillator circuits or adding a waveform generation IC is much easier when you use the right PCB design and analysis software package. The layout and simulation tools in capability of OrCAD PSpice Simulator and the full suite of analysis tools from Cadence allow you to build and analyze the behavior of your oscillator circuits, as well as help you identify signal problems that can arise in complex layouts.

If you’re looking to learn more about how Cadence has the solution for you, talk to us and our team of experts.