Sunday 17 February 2019

analog - What is the best way to get a sine wave from a square wave?


I have square waves of different frequencies (1KHz to 20KHz), and I need to convert them to a sine wave of the corresponding fundamental frequency.


A RC ladder Low-pass filter was the first thing which I tried, It gave good results but the output peak-to-peak voltage (Vpp) varied a lot with the frequency. The square wave has a Vpp of 3.6V. But after filtering, the output Vpp of the sine wave varies from 3V to 2V as the frequency increases.



Is there any other better way to get a pure sine wave from square wave of same frequency without this voltage drop?


Thank you



Answer




Is there any other better way to get a pure sine wave from square wave without this voltage drop?



Take your square wave and use a phase lock loop to generate a frequency that is maybe 50 times higher: -


enter image description here


Then use a clock tunable filter like this: -


enter image description here



Feed your square wave at the input (Vin) and you should get a pretty decent looking sinewave at the output.


It works by tracking the input frequency using the PLL - typically at an input frequency of 20 kHz the PLL output is 1 MHz and this is used by the LTC1066 to set its cut-off frequency to 20 kHz. Here's what LT say the frequency response looks like at the extremes of operation: -


enter image description here


Given that a square wave is composed of odd harmonics you need a steep filter that gives many dB attenuation at the most dominant harmonic (3rd). Look at the graph for 800 Hz low pass operation. At 800 Hz the response is approximately 0 dB and at 2.4 kHz (3rd harmonic) the attenuation id greater than 80 dB (10,000:1).


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...