# Using active BPF to convert a square wave into a sine

I have an inverter that converts 24 V DC to a 48 VAC peak-to-peak square wave with a frequency of 55 Hz. I am then going to use a step-up transformer to output 120 VAC to power some rocket valves that take maximum 150 VA.

We are not sure which ones we are using yet, but I want to provide 150 VA to make sure.

My approach was to use an active wide band pass filter to convert the square wave into a sine wave. The schematic has a first order high pass filter, a non-inverting amplifier that controls the gain, and a low pass filter.

I set the HPF's cutoff frequency to be 50 Hz ($$\f_o = 1/(2*\pi*R*C) \$$ for a first order filter) and the LPF to be 60 Hz. I also set the gain to be 1 by setting $$\ R_4 = 1M\$$ and $$\R_3=100 \$$.

What is wrong in this setup? Why is the output sine not a perfect wave? And if this op-amp cannot provide the inrush current needed, what circuit is capable of preserving power while converting this square into a sine?

• With 1 opamp, configure it as a 3rd order LPF (no need for HPF at all). First order filter is just far too poor at rejecting higher harmonics for your needs.
– user16324
Feb 15, 2020 at 22:22
• @BrianDrummond What is the transfer function for this? Feb 15, 2020 at 22:27
• There isn't a unique one ... search "3rd order Chebyshev LPF" should get something appropriate : simulate it. If it still isn't good enough, Andy's right you may need more, so try 5th, 7th, 9th order until you find one that is. Or, modify a Cauer filter so the notch (or notches) are aligned with 3rd,5th harmonics.
– user16324
Feb 15, 2020 at 22:34
• @BrianDrummond it looks like he's going from a raised square wave; if he wants a sine wave with zero DC content he'll need a DC blocker. Feb 15, 2020 at 23:19
• The op has also said he needs to drive a load of 150 VA and his previous question on this is here: electronics.stackexchange.com/questions/480463/… Feb 15, 2020 at 23:39

I am using an active wide band pass filter to convert a square wave into a sine wave.

For a start, using a band pass filter is wasting circuitry because, in order to convert a square to a sinewave, you need to remove higher order harmonics above the fundamental frequency and that can be more effectively done with two cascaded low pass filters.

Secondly, if you want anything like a decent shape to the sinewave you’d be looking at a minimum of 4 cascaded low pass filters. On one application I had (where I just couldn’t tolerate any amplitude change across a range of squarewaves between 500 Hz and 700 Hz), I used a 12th order filter To get me about a 32 dB reduction in the third harmonic.

So decide what 3rd harmonic level you can tolerate and design the order of the filter to provide the attenuation needed to reduce that 3rd harmonic.

• I need an active filter because my load needs a certain amount of energy. Feb 15, 2020 at 22:30
• My answer doesn’t explicitly rule out that the implementation is active. An active filter uses (normally) an amplifier in order to improve two 1st order cascaded filters and this would be a natural progression from my direct words but, take note, the circuit in your question is not an active filter; it’s two first order filters with an opamp buffer in between. What power load are you talking about? Feb 15, 2020 at 22:37
• Rocket Valves that take 150 VA. Essentially I created an inverter circuit that outputs a 55 Hz square wave. I want to turn this into a sine wave. Feb 15, 2020 at 22:55
• How pure a sine wave? (e.g. what 3rd harmonic level is acceptable?) Feb 15, 2020 at 23:06
• @Hector you won’t achieve that this way. You need inductor capacitor filters and you need to design them very carefully or you’ll just get smoke and flames. I see that this question is really a follow up to one of your previous questions and the problem with this new question is that you give no indication what your load is and you steer answerers down the path of assuming that you are dealing with signals rather than a big grunt of power. You will not get standard active filters to do this job. Feb 15, 2020 at 23:15