All About Circuits Forum  

Go Back   All About Circuits Forum > Electronics Forums > General Electronics Chat

Notices

General Electronics Chat Discussion forum for general chat about anything electronics related, including asking questions about material in the All About Circuits E-book, Worksheets, and Videos.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 01-04-2011, 04:03 AM
Veracohr Veracohr is offline
Senior Member
 
Join Date: Jan 2011
Posts: 192
Default Sine wave generation - logarithmic shaping

Greetings!

Could anyone possibly explain, from National Semiconductor's AN-263 "Sine Wave Generation Techniques" page 11 - Logarithmic Shaping, how the "logarithmic relationship between Vbe and collector current in transistors" shapes a triangle wave to an approximation of a sine wave? Maybe my math isn't up to the task, but I don't see how a logarithmic response becomes a sine wave.

http://www.national.com/an/AN/AN-263.pdf

I wasn't able to get this shaper working, although admittedly I changed it based on what I have at hand. Still, I always understand circuits better when I know the why as well as the how.

Thanks!
Reply With Quote
  #2  
Old 01-04-2011, 04:33 AM
thatoneguy's Avatar
thatoneguy thatoneguy is offline
Senior Member
 
Join Date: Feb 2009
Location: Midwest USA
Posts: 6,356
Blog Entries: 4
Default

It's math, essentially.

integrate square wave = triangle wave
integrate triangle wave = sine wave

differentiate sine wave = triangle wave
differentiate triangle wave = square wave

When you integrate or differentiate some waveforms, you will often find a natural logarithm or exponent show up.
Reply With Quote
  #3  
Old 01-04-2011, 05:19 AM
bitrex bitrex is offline
Member
 
Join Date: Dec 2009
Posts: 79
Default

The circuit you're looking at generates a sine wave from a triangle wave by using the properties of the differential pair of transistors contained in the LM394. The transconductance of a differential pair of transistors is defined to be:



Where I_o is the tail current, Vid is the differential input voltage, and VT is the thermal voltage - 26 mV at room temeperature.

In the case of this circuit, the output voltage will be approximately:



Where RL is the 100 ohm load resistor on the output. The division by 2 happens because you're only taking a single ended output, not a differential output.

So the output voltage will be a function of the input voltage and the hyperbolic tangent. The first few terms of the Taylor series of the sine and hyperbolic tangent functions are:

Sine:

Hyperbolic Tangent:

If you compare the two Taylor series you will see that they are both linear to first order. What this means is that if you apply a triangle wave to a differential pair with a hyperbolic tangent transfer function, and keep the amplitude _low_, what you get out should be indistinguishable from a sine wave! That's the purpose of the two 5k resistors and the 200 ohm resistor in the circuit going into the differential pair - it's to divide down the triangle wave signal from the oscillator in an attempt to keep the circuit operating in the amplitude range where the output is a low distortion sine wave.

You can take a look at this paper for some more of the math involving analysis of a similar circuit, including THD calculations:

http://electrooptical.net/www/sed/TanhSineShaper.pdf

The original National paper certainly doesn't explain the method very well, but the hyperbolic tangent approximation to a sine is what the circuit you refer to is using.

Last edited by bitrex; 01-04-2011 at 05:26 AM.
Reply With Quote
  #4  
Old 01-04-2011, 05:29 AM
Kermit2's Avatar
Kermit2 Kermit2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 2,385
Default

Visualize the difference in a linear graph and a Log graph.

The lines in a log graph get closer together as you go from 1 to 10.

A sine wave shape on a linear graph will produce an almost straight line on a log graph.

Therefore a linear voltage ramp (triangle wave) can generate a sine wave if the resistance (base/emitter) has a logarithmic response to current flow in the collector.

When graphed linearly of course!
__________________
I'm too old.
Reply With Quote
  #5  
Old 01-04-2011, 05:33 AM
Veracohr Veracohr is offline
Senior Member
 
Join Date: Jan 2011
Posts: 192
Default

Aha! Thank you bitrex!
Reply With Quote
  #6  
Old 01-05-2011, 02:48 AM
Veracohr Veracohr is offline
Senior Member
 
Join Date: Jan 2011
Posts: 192
Default

Quote:
Originally Posted by Alberto View Post
More simply because the circuit uses a RC function to obtain the sine aproximation. And the time required for the voltage to fall to V0/2.718281 is called the RC time constant (where 2.718281 is the natural log base)

Cheers

Alberto
bitrex's explanation made sense but your simpler one doesn't. There's no capacitor in the circuit after the triangle-producing integrator. The notes specifically say "The LM394 dual transistor is used to generate the actual shaping..."
Reply With Quote
  #7  
Old 01-05-2011, 03:02 AM
Audioguru Audioguru is offline
Banned
 
Join Date: Dec 2007
Location: Ontario, Canada
Posts: 9,411
Default

It was a 40 years old way to make a pretty poor sine-wave.

About 10 years ago I made a stepped sine-wave from a CD4018 digital IC. It had 10 steps. It made an "oversampled" sine-wave. Then I used a switched-capacitor 8th-order Butterworth lowpass filter IC to remove the remaining harmonics so the distortion was only 0.005% or less.
Reply With Quote
  #8  
Old 01-05-2011, 03:24 AM
Bill_Marsden's Avatar
Bill_Marsden Bill_Marsden is offline
Super Moderator
 
Join Date: Mar 2008
Location: Dallas, TX (GMT-5 w/ DST)
Posts: 18,824
Blog Entries: 5
Default

As AudioGuru says, it can get you in the ball park without being perfect. I've used back to back diodes, and just looking at it it is hard to tell the difference. However, overlay it with a good sine wave and it jumps out at you.

555 Function Generator
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
Reply With Quote
  #9  
Old 01-05-2011, 03:29 AM
Veracohr Veracohr is offline
Senior Member
 
Join Date: Jan 2011
Posts: 192
Default

Quote:
Originally Posted by Bill_Marsden View Post
As AudioGuru says, it can get you in the ball park without being perfect. I've used back to back diodes, and just looking at it it is hard to tell the difference. However, overlay it with a good sine wave and it jumps out at you.

555 Function Generator
I read that thread, and others here, but I wanted specifically to know about the logarithmic shaper thing. Not because it's better but because I wanted to know how it worked.

All in my poor-man's quest to try getting a sine wave for testing purposes without having to buy a proper function generator.
Reply With Quote
  #10  
Old 01-05-2011, 04:53 AM
Bill_Marsden's Avatar
Bill_Marsden Bill_Marsden is offline
Super Moderator
 
Join Date: Mar 2008
Location: Dallas, TX (GMT-5 w/ DST)
Posts: 18,824
Blog Entries: 5
Default

Mine too, which is why I worked on that circuit (and will again). They sell a lot of function generator chips out there, which IMO is the best way to go around it. I don't like digital shaping circuits because the oscillator has to run at least 10X the output waveforms speed (probably more). If you are willing to truly shape the waveform you can use multiple diodes (8 or more) that slowly hand off the shaping duty when it enters the next circuits domain. Problem is, there are frequency response considerations, just because it works at one frequency doesn't mean it will work on another.

The dual diode method I explored is close enough for me. If I need a precision sine wave I'll build something that does it from scratch, and not worry about the other waveforms.

Bill's Index

Sine Wave Oscillators A PDF abstract by TI
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
Reply With Quote
Reply   Post New Thread

Tags
, , , ,


Related Site Pages
Section Title
Worksheet Logarithms for analog circuits
Worksheet Design Project: audio media-based signal generator
Worksheet Design Project: Simple component curve-tracer circuit
Worksheet Passive integrator and differentiator circuits
Worksheet Mixed-frequency signals
Textbook AC voltmeters and ammeters : Ac Metering Circuits
Textbook More on spectrum analysis : Mixed-frequency Ac Signals
Textbook Other waveshapes : Mixed-frequency Ac Signals
Textbook Square wave signals : Mixed-frequency Ac Signals
Video Lecture Generation of Alternating Voltage - Alternating Current


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifed Sine Wave Inverter aliman1 The Projects Forum 23 12-10-2010 11:09 PM
sine wave generation electronics1 General Electronics Chat 3 01-18-2010 02:48 AM
Sine wave generation ecslabsiuc The Projects Forum 2 09-23-2009 06:35 PM
triangular to sine wave kahafeez The Projects Forum 13 12-16-2008 07:27 PM
Sine Wave Generation kaleanae Programmer's Corner 6 11-13-2007 08:22 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:29 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.