• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Analog IC Tips

Analog IC Design, Products, Tools Layout

  • Products
    • Amplifiers
    • Clocks & Timing
    • Data Converters
    • EMI/RFI
    • Interface & Isolation
    • MEMS & Sensors
  • Applications
    • Audio
    • Automotive/Transportation
    • Industrial
    • IoT
    • Medical
    • Telecommunications
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • FAQs
    • EE Learning Center
    • EE Training Days
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Design Guide Library
    • Digital Issues
    • Engineering Diversity & Inclusion
    • LEAP Awards
    • Podcasts
    • White Papers
  • Video
    • EE Videos
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

5 ways to generate a sine wave

March 21, 2014 By Chris Francis 4 Comments

It is not uncommon to need a sine wave but how do you generate it? The “best” or most appropriate method for a particular application depends on several things such as:

  • frequency,
  • purity required,
  • amplitude,
  • possible synchronization with another frequency,
  • variable frequency and/or amplitude.

At lower frequencies a Wien bridge might be considered – for frequencies of up to maybe 1MHz (although in theory it could be used considerably higher in frequency). One disadvantage is it is not easily tunable because the frequency depends on more than one component. Also Wien bridge oscillators need an amplitude stabilization method. This is often a JFET but could be diode based, or even using a small incandescent lamp (not my preferred approach!) or thermistor.

Sine Wave Generation

Other options are LC or crystal oscillators which have their place in the designer’s tool kit. If you need to generate a sine wave which is based on a given clock then a different approach is required. A typical situation would be where you need a sine wave based on a precision frequency generated by a microcontroller, CPLD or FPGA. In that case you would presumably have a square wave and need to generate your sine wave from that. If you could make your square wave frequency higher than the desired sine wave then you could digitally generate a sine wave using a sine lookup table. That is the principle used in some DDS (Direct Digital Synthesis) chips – using a DAC (Digital to Analog Converter) and generating the analog values of the sine wave in your digital device. You would also need some analog filtering to remove the higher frequency components of the resulting stepped waveform.

You don’t even need to use a DAC – you could use sine PWM (Pulse Width Modulation). Here you would generate a square wave at a multiple of the desired sine wave and vary the width – not linearly but in a sinusoidal fashion. Then simply filter the output to end up with a sine wave. The waveform below shows the sine PWM signal (top – red) and the filtered result. In this case the PWM frequency is a little under 40 times the desired sine wave frequency.

Sine Wave Generation

Doing the same thing with a DAC produces a similar result but with the pre-filtered output looking a little different:

Sine Wave Generation

Another method is simply to filter a square wave. In that case you will generate a waveform at the same frequency as the square wave rather than a lower frequency. The trade off then comes from how much filtering you need to do to achieve the signal purity you require. The DAC and sine PWM approach can have very simple filtering as the unwanted harmonics are many times the sine frequency. A two pole filter will give very good results and even a single pole filter can be used if the PWM frequency is high enough. The filter would be chosen to attenuate the PWM/DAC frequency while not affecting the sine frequency, but this does not preclude having a variable frequency. Reducing the frequency would involve changing the PWM data but still sending it to the filter at the same frequency. In this was the filtering can stay the same even with a variable frequency.

Variants of these techniques are used in power inverters – using multi-level inverters or a combination of multi-level inversion with sine PWM. Those techniques involve switching power to a positive and negative voltage, zero volts and two or more voltages in between. This creates a very crude DAC based signal but with only 5 levels (or 7 or more depending on how many levels are used). The “DAC” in this case is actually high power and driving an inverter transformer. Adding the “sine PWM” to the technique can smooth out the large steps which result from such coarse steps.

Using a square wave at the same frequency as the desired sine wave requires high suppression of the third harmonic without affecting the fundamental signal. A 4 pole Chebyshev filter is probably the minimum in order to obtain a good sine purity. Having a variable frequency is then tricky.

Another technique which is not commonly used in discrete circuitry, but can make sense in an analog custom IC is to shape a triangle wave. A triangle is easy to generate simply by charging and discharging a capacitor with a constant current. It also isn’t too far from a sine wave with only 12% distortion. Rather than simply filtering the triangle, it can be “shaped”. This is something illustrated by the late Hans Camenzind in his “Designing Analog Chips” book. The principle is simply round off the peaks of the triangle so it looks more sinusoidal. His proposed circuitry is shown below:

Sine Wave Generation

and the results:

Sine Wave Generation

Filed Under: FAQ, Industry Experts Tagged With: basics, commentary, FAQ

Reader Interactions

Comments

  1. Dustin says

    April 25, 2014 at 8:52 pm

    There are a few more ways to change a triangle wave into a pseudo-sine wave, which should give much lower distortion. (at least in the lower frequency applications that I’ve used them in)

    One method involves using a FET to create the curve, another uses two NPNs (differential pair,) and a third (sort of hybrid method) uses an OTA. (obviously I’m coming from an audio point of view here, but I imagine they would work) There are quite a few good writeups out there for these methods.

    Thought I’d mention them though.

    Log in to Reply
  2. DonQ says

    May 1, 2014 at 5:50 pm

    Just FYI… the shaping of a triangle wave into a sine using voltage breakpoints, like in your Camenzind example, has been in use for a *very* long time. The ICL8038 used this to generate a sine down to less that 1% THD back in the 70’s. Prior to that, I had an old, used, audio frequency generator that had a discrete version of the same basic circuit. (I would suspect there were even vacuum-tube based circuits using the same principle.) Careful selection of breakpoints and shunt values can produce very low distortion sine waves. Some modest post filtering would improve the quality of the output even further.

    Log in to Reply
  3. Jerry Steele says

    July 18, 2014 at 6:02 pm

    I don’t know why so many text books show classic phase shift oscillators with high pass feedback
    networks. One of my favorite tricks is to use 3 stages of low pass. Here’s where it throws
    everyone off: the output of the oscillator is the feedback input terminal (usually the inverting
    input) of the op amp. Sure the amplitude is way down from that of the square wave output,
    but its a pretty decent sine wave.

    Log in to Reply
  4. sumit yadav says

    November 10, 2015 at 3:12 am

    Hi, we are also working on that. we are able to generate pwm with one duty cycle. but we are having problem in generating multiple duty cycle so that after filtering we get the sine wave. can you help ????

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Featured Contributions

High-Performance GPUs Are Located in a Variety of Environments, including Data Center Racks.

AI’s demand for faster, more reliable IC testing

Design a circuit for ultra-low power sensor applications

Active baluns bridge the microwave and digital worlds

Managing design complexity and global collaboration with IP-centric design

PCB design best practices for ECAD/MCAD collaboration

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: Connectivity
AI and high-performance computing demand interconnects that can handle massive data throughput without bottlenecks. This Tech Toolbox explores the connector technologies enabling ML systems, from high-speed board-to-board and PCIe interfaces to in-package optical interconnects and twin-axial assemblies.

EE LEARNING CENTER

EE Learning Center
“analog
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

EE ENGINEERING TRAINING DAYS

engineering

RSS Current EDABoard.com discussions

  • PWM or potentiometer to control speed on saw
  • STM32 multiprocessor communication UART
  • analyzing current limiting switch circuit
  • Primary current sense in LLC
  • kit iron soldering question

RSS Current Electro-Tech-Online.com Discussions

  • CR2/CR123A Batteries In Projects
  • Arduino standalone minimal
  • analog logic of shmidt trigger bjt circuit
  • Convenient audio FFT module?
  • Harman Kardon radio module BMW noise
“bills

Footer

Analog IC Tips

EE WORLD ONLINE NETWORK

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Battery Power Tips
  • Connector Tips
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

ANALOG IC TIPS

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2026 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy