Square wave to sine wave conversion?

Discussion in 'The Projects Forum' started by spasticteapot, Jan 5, 2010.

  1. spasticteapot

    spasticteapot Thread Starter New Member

    Joined:
    Nov 14, 2009
    Messages:
    4
    Is there a good way to convert a square wave between 50hz and 5khz to a reasonably neat sine wave?
  2. ericwertz

    ericwertz Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Location:
    USA
    Depends entirely upon what you mean by "good".

    You've pretty much stumbled on the totality of what "engineering" is all about.
  3. BillB3857

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    Messages:
    2,104
    Location:
    St.Louis, MO area (GMT-6)_
    Last edited: Jan 6, 2010
  4. Bill_Marsden

    Bill_Marsden Moderator Staff Member

    Joined:
    Mar 24, 2008
    Messages:
    19,253
    Location:
    Dallas, TX (GMT-5 w/ DST)
    What is the source of the square wave?
  5. russ_hensel

    russ_hensel Well-Known Member

    Joined:
    Jan 11, 2009
    Messages:
    814
    Location:
    South Dartmouth Ma
    Particurlarly hard to do if you want to vary the frequency and have the output amplitude to stay the same. I wonder if a phase lock loop could manage this.
  6. davebee

    davebee Well-Known Member

    Joined:
    Oct 22, 2008
    Messages:
    527
    Location:
    San Francisco Bay area
    A microcontroller could be programmed to read the period of the incoming square wave and use pulse width modulation to generate a sine of the same frequency over that range.

    If the PWM was much faster than 5 kHz then a single high-frequency low-pass filter might be good enough to clean up the entire frequency range well enough.
  7. danny2

    danny2 New Member

    Joined:
    Oct 28, 2009
    Messages:
    29

    mind to know whr is the breakpoint voltage?when i simulate on pspice,the value for Iu is wrong,some of the formula are wrong too.please check it out.

    use my circuit that i attach,and use the formula on the pdf to calculate according my circuit.
    the red arrow indicate current flow

    Attached Files:

    Last edited: Jan 10, 2010
  8. BillB3857

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    Messages:
    2,104
    Location:
    St.Louis, MO area (GMT-6)_
    Danny,
    I am not the author of the article so cannot lend any insight into how it was developed or respond to any errors it may contain. I simply located it and presented it for your evaluation.. Now to your simulation. Please note that the total conversion is made by having multiple sections, each providing a slightly different slope at different activation levels or breakpoint. From the first paragraph on the first page........

    "The sine converter is a classic diode-resistor multiple -breakpoint shaper It achieves an approximately piecewise - linear sinusoid approximation and is based on optimizing the breakpoint locations to minimize function error by uniformly spreading the error across a range of the function. The five-breakpoint circuit is shown below."

    Your simulation shows only one section and would only produce a slight modification to the slope of the triangle wave applied to its input. With multiple sections, as the input continues to rise, more and more modification to the slope would be evident, up to the point of the peak where the slope would approach almost flat.
  9. danny2

    danny2 New Member

    Joined:
    Oct 28, 2009
    Messages:
    29
    i know you are not the author.
    i was referring the formula and did some calculation for the circuit.see the page 2.i was very vey confuse about this formula on page 2.i spend alot of time today by analysis it,but some formula seem error and i dont know how to fixed it.im here by asking for help about the formula on page no.2.
  10. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    Messages:
    9,411
    Location:
    Ontario, Canada
    I used a switched-capacitor lowpass filter IC to convert a square-wave into a very good sine-wave. The cutoff frequency of the filter is adjusted with the frequency of its clock which is 100 times the cutoff frequency.
  11. BillB3857

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    Messages:
    2,104
    Location:
    St.Louis, MO area (GMT-6)_
    Maybe you could send a PM to member named "Mathematics!" (with the explanation point) He stated in another thread that he has a Master's Degree in Pure Mathematics.
  12. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,290
    Location:
    Tucson AZ USA
    Also check out Forrest M. Mims III, Engineers Notebook II, pg 81; 4 op amps, first square wave gen, 2nd, to triangle, 3rd triangle to sine, 4th amplifier. Two caps used in conversion. Fixed frequency of 1 kHz.
Similar Threads
Forum Title Date
The Projects Forum Square Wave Generator Construction Jul 21, 2014
The Projects Forum Finalizing a modified square wave inverter.... May 30, 2014
The Projects Forum 100/-100V square wave generator from 170AC source May 13, 2014
The Projects Forum Square Wave Generator design help. Mar 16, 2014
The Projects Forum sloppy sine to square wave Mar 16, 2014

Share This Page