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
    4
    0
    Is there a good way to convert a square wave between 50hz and 5khz to a reasonably neat sine wave?
     
    #1
  2. ericwertz

    ericwertz Member

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

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

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    2,281
    304
    Last edited: Jan 6, 2010
    #3
  4. Wendy

    Wendy Moderator

    Joined:
    Mar 24, 2008
    20,043
    2,054
    What is the source of the square wave?
     
    #4
  5. russ_hensel

    russ_hensel Well-Known Member

    Joined:
    Jan 11, 2009
    818
    47
    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.
     
    #5
  6. davebee

    davebee Well-Known Member

    Joined:
    Oct 22, 2008
    539
    46
    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.
     
    #6
  7. danny2

    danny2 New Member

    Joined:
    Oct 28, 2009
    29
    0

    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
     
    Last edited: Jan 10, 2010
    #7
  8. BillB3857

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    2,281
    304
    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.
     
    #8
  9. danny2

    danny2 New Member

    Joined:
    Oct 28, 2009
    29
    0
    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.
     
    #9
  10. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    9,411
    886
    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.
     
    #10
  11. BillB3857

    BillB3857 Senior Member

    Joined:
    Feb 28, 2009
    2,281
    304
    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.
     
    #11
  12. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    3,647
    320
    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.
     
    #12
Loading...