Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Square wave 2 Sine Wave convertion

Status
Not open for further replies.

Frosty_47

New Member
Square wave 2 Sine Wave conversion

Hello,

I would like to convert a TTL square wave into sine wave. The frequency range of the square wave is: 4Hz-60Hz (yes its those evil low frequency experiments that I plant to take over the world with :)). I also would like to convert TTL into a regular wave.

Any suggestions would be greatly appreciated

Thanks
 
Last edited:
This is no simple way to convert a variable frequency square wave to a sine wave.

One approach is to filter the square wave with a high order filter. But if the frequency varies then you need a tracking filter whose center frequency varies with the input frequency. That's not trivial to do.

Another technique is to run the square-wave through two integrators in series. The first integrator generates a triangular wave and the second generates a sine wave. The problem is that the output amplitude is inversely proportional to the square of the frequency so you need some sort of AGC circuit to maintain a constant amplitude. For a frequency range of 4Hz-60Hz the amplitude would vary by a factor of 225 or 47dB.
 
A switched-capacitor Butterworth lowpass filter IC uses a clock that is 100 times the cutoff frequency. The clock can be the VCO of a phase-locked-loop IC and a digital divider produces the fundamental frequencies.

Maxim-IC has many filter ICs. Square-wave in, perfect sine-wave out.
 
DDS ICs produce sinewave outputs at frequencies right down to mHz. (Yes, milli Hertz. One cycle in 1000 seconds)

You need to clock them many times faster than the output frequency and you tell them the frequency digitally, so it is not a direct conversion, but that might help.
 
thank you

audioguru said:
A switched-capacitor Butterworth lowpass filter IC uses a clock that is 100 times the cutoff frequency. The clock can be the VCO of a phase-locked-loop IC and a digital divider produces the fundamental frequencies.

Maxim-IC has many filter ICs. Square-wave in, perfect sine-wave out.

I tried reading the datasheet for MAX7400-7407 but I am confused. Most of the information presented on the datasheet is new to me. From what I understood, the output frequency will = Fclk/100. So I made some adjustments to my circuit below:

**broken link removed**

I cannot locate any mention of "square wave to sine conversion" on the datasheet. Am I on the right IC? If not please provide a part number.

Thanks
 
A square-wave is made with a fundamental frequency plus odd numbered harmonics like the 3rd, 5th, 7th etc.
A switched-capacitor Butterworth filter IC with 4 orders will reduce the 3rd harmonic's level to -24dB. Higher harmonics are reduced more.
If the filter has 8 orders then the 3rd harmonic is reduced 48dB.

With the harmonics reduced then the output is a pretty good sine-wave.
 
If you know exactly what you are generating, you could use more than 1 filter and direct your square wave to a separate filter depending on the frequency. Each filter can have satisfactory characteristics over an octave. use a DeMUX to send the signals to different filters.
 
What about adding a unity gain buffer on the capacitor and getting a triangle wave?

This would make it less work for the filter. The problem is that the attentuation is greater at higher frequencies than lower frequencies. If you put it through an AGC amplifier after it's been through the filter then you could hopefully stablise the output amplitude enough.
 
SPL levels at low frequency's

low frequency experiments that I plant to take over the world with

I remember someone talking about low frequency's one time saying some Like "Sonar" ranges can cause people to suddenly defecate ?

Hmm ? :p
 
Mythbusters tried very powerful very low frequencies and he didn't deficate but he nearly vibrated himself to death.
Their speakers were crap. They should have used sub-woofers for cars.
 
audioguru said:
Mythbusters tried very powerful very low frequencies and he didn't deficate but he nearly vibrated himself to death.
Their speakers were crap. They should have used sub-woofers for cars.

Didn't see your smily there?, you have of course got that the wrong way round! :D
 
Sound Vehicals "Damaging to Humans"

Didn't see your smily there?, you have of course got that the wrong way round!

Unless you actually have the courage "stupidity" to sit in some of them ! :D
 
I forgot about which punctuation converts a "D" into a smiley.
Sure their speakers were crap. It sounded like they deficated all over the place. :D
 
Last edited:
the mythbusters have some good ideas but they seem to always fall flat on their face with mistakes. i would do things a little differently than they do before i would say some of their myths are busted.
 
"Sonar" ranges can cause people to suddenly defecate ?

If true, could have explained why these guy's with boom box cars have low riding jeans.

Mythbusters investigated that, and found it to be false :D

There would have been no reason to investigate. :D
 
Back to the sine wave. You never mentioned what kind of distortion you can stand. You could use a binary counter driving an EPROM loaded with a sine wave table and vary the clock frequency. An 8-bit sine wave distortion is surprising low -- the digital step aspect just makes it sound like it would have a high THD percentage.

Dean
 
killivolt said:
If true, could have explained why these guy's with boom box cars have low riding jeans.
Have you noticed that their cars have low riding everything? So it is easy to shovel out the crap?
 
Back to the sine wave.

Sorry, having way to much fun with the Homeys.

Have you noticed that their cars have low riding everything? So it is easy to shovel out the crap?

:LOL: Ha Ha Ha Freak-in Hilarious :D
 
Originally Posted by audioguru
So it is easy to shovel out the crap?


I can see it as they roll up next to me boom box blaring dark glasses looking big and bad.

But then I remember and begin laughing uncontrollably.


That's when they pop a cap in me. :p
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top