# Square wave to sine wave conversion?

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

1. ### 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?

2. ### 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.

3. ### BillB3857 Senior Member

Joined:
Feb 28, 2009
2,357
324
Last edited: Jan 6, 2010
4. ### Wendy Moderator

Joined:
Mar 24, 2008
20,502
2,360
What is the source of the square wave?

5. ### 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.

6. ### 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.

7. ### 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

File size:
51.3 KB
Views:
413
File size:
14.7 KB
Views:
389
• ###### formula.JPG
File size:
44.4 KB
Views:
274
Last edited: Jan 10, 2010
8. ### BillB3857 Senior Member

Joined:
Feb 28, 2009
2,357
324
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 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.

10. ### Audioguru New Member

Joined:
Dec 20, 2007
9,411
888
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 Senior Member

Joined:
Feb 28, 2009
2,357
324
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 Senior Member

Joined:
Aug 7, 2008
3,838
348
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.