LP Filtering Squarewaves After Mixing

Jul 07, 2015 13 Replies

Assuming that by "mix" you mean "multiply", then there will be many different components of the mixed sine waves - eight to be precise. If you only want the lowest of these components, they'll be well below the audio range of any of the input signals (since you said they're close in frequency) you should be able to get away with computing the parity (use three dual-input XOR gates) and LP filter that.

Parity is multiplication in the digital realm.

Clifford Heath

I have four square waves of slightly different audio frequencies, and want to derive something resembling a mix of four sinewaves of the same frequencies.



Is there any disadvantage in mixing the squarewaves _before_ I LP filter them so I can then run the composite signal through just one filter, and not have to use four separate ones?



I understand the latter would be more precise in processing each frequency, but I am willing to compromise.



Mark Granger


Also, is there any particular type of filter that would be most suitable for the purpose mentioned in my OP?

Thanks,

Mark Granger

"Mixing" to an audio guy is adding.

"Mixing" to a radio guy is multiplication.

Which is your "mixing"?

www.wescottdesign.com

If by mixing you mean summation, then no, as far as I know there's no major advantage to low-pass filtering the square waves before summing. The only thing I can think of is that the summing amplifier might have nonlinearities that would cause intermodulation distortion and subharmonics to appear, but I'm not sure how much of an issue this might be at audio frequencies

** Nope.

The lowest harmonic needing attenuation is the third - so a steep filter ( say -24db/oct ) commencing just above the highest of your square wave frequencies will do a reasonable job of shaping them into sines.

The result is gonna be a weird sounding mess of beat patterns though.

.... Phil

I am an audio guy who knows nothing about radio.

Just as well, since "multiplication" to too long a word for me to use ;-)

Mark Granger

Thanks for your advice Phil.

For anyone who is interested, I believe the third illustration down on this page shows such a filter.

formatting link

Mark Granger

Why don't you synthesise sine waves if that is what you want?

It is difficult to filter all the harmonics out of a square wave!

Even a relatively steep low pass filter will only get you so far at reducing the third harmonic.

Integrating the original square waves to triangle waves and then a bit of diode shaping would probably be the least worst crude option.

Regards, Martin Brown

** A single -12dB/oct filter fed with a square wave at the 3dB down point gives a visually perfect sine wave on a scope. THD being a little over 1%.
** The OP's idea is much simpler & performs far better.

.... Phil

Since the frequencies are close together, one filter won't be far off optim um, true. Depending on the details, the OP might be able to choose a filter with a deep null near the third harmonics, which will help quite a bit.

To the OP: if you pick an op amp active filter, be sure to knock the corner s off the input waveform with a passive RC section before the op amps. Othe rwise you may get a lot of distortion from slew-limiting.

Cheers

Phil Hobbs Phil Hobbs

Yes.

You can design individual filters for each, making them as sharp as possible for the exact frequency. Then mix later.

In practice, if the frequencies are within a 10% span or so, this will make only academic difference for all but the sharpest filters. Or to put it another way: you're better off by adding more orders to a single filter, than using a slightly lower order times N channels!

Tim

Then you can mix followed by filtering, with the various caveats already stated.

Tim Wescott Wescott Design Services http://www.wescottdesign.com

yes you can mix (add) first and then filter as long as the mixer (adder) has no non-linearity.

Also if the frequencies are close to each other and don't move much, you may find it more effective to use a band pass filter instead of a low pass filter.

You can get a steeper roll off for the same number of parts.

Mark

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required