Mixed Square Waves Filtered vs. Sinewaves

What is the difference in terms of frequency content between the following two composite signals?

  1. Squarewaves at 50, 75 and 150Hz, mixed and then low pass filtered as one to resemble, as best as possible, a mixture of sinewaves,

  1. A similar mixture of pure sinewaves themselves.

IOW, in example 1, will the frequencies listed still be dominant in the mixed and filered signal, or obscured by by interaction of the rectalinear waveforms.

To what extent would this be governed by duty cycle, i.e. if the squarewave duty cycles differed from each other.

Thanks for any insight.

Klaus Jensen

Reply to
Klaus Jensen
Loading thread data ...

If the square waves were perfectly summed and then put through a perfect brickwall filter above 150 Hz, then there should be no difference between the two signals. But that is a big "If." In the real world the discrepancy will depend on the implementation.

Reply to
bitrex

Assuming by mixing you meant "summing" and not non linear mixing, like for converting RF signals.

Reply to
bitrex

ne to resemble, as best as possible, a mixture of sinewaves,

A 50% duty cycle square wave Fourier-transforms into the sum of all the odd harmonics, with the amplitude of each harmonic inversely proportional to t he harmonic number. 150Hz is the first odd - third - harmonic of 50 Hz, and it's harmonics contribute to some of the odd harmonics of 50Hz (or may can cel them depending on the phase relationship with the 50Hz).

75Hz isn't isn't an odd harmonic of 50Hz, and it's harmonics don't coincide with those from 50Hz and 75Hz

That won't have any odd-harmonic content to be filtered out.

ixed and filered signal, or obscured by by interaction of the rectalinear w aveforms.

In a linear system, there aren't "interactions" between the various Fourier elements making up the waveform.

ve duty cycles differed from each other.

If the square-wave duty cycle isn't 50%, you will start seeing some even or der harmonic content.

The extreme non-50% duty cycle waveform is the Dirac spike, which has every harmonic (every multiple of the spike repetition frequency) at an equal (b ut vanishingly small) amplitude.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

After reading Bill's post, I forgot that this assumes all the square waves are in phase.

Reply to
bitrex

No, nevermind. I guess you asked if there would be any difference in terms of frequency content, not amplitude. There wouldn't be. I'm too tired to be posting!

Reply to
bitrex

Take the theoretically impossible sub-harmonic of 50HZ, as a fundamental 25Hz sine to start the synthesis. On that basis, you would be using the second, third, and 6th harmonic; not exactly the best choice to synthesize a square wave from sine waves (1,3,5 or 2,4,6 much better). I leave the rest to the student.

Reply to
Robert Baer

And the phase relationships.

Reply to
Robert Baer

Check; that seems to be the implication.

Reply to
Robert Baer

That is one presumption; the other is "fiddle for best fit".

Reply to
Robert Baer

35 years ago at uni, I used to piss about in all sort of manners trying to analytically solve all that sort of stuff. We have moved on.

Just go and set up a spice simulation, and you're done. e.g. LTSpice, or SuperSpice :-)

One get a surprisingly good understanding of the real world by simulating, rather than mental gymnastics on paper. Its the only way for colliding,rotating black holes, where there are no paper and pencil solutions.

Kevin Aylward

formatting link
formatting link
- SuperSpice

Reply to
Kevin Aylward

Or, as I like to do, run the simulation, see how it talks to you. From that information you can often see how to create a mathematical solution... which I then apply to behavioral models >:-} ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

I assume you mean LTIC "summed" not "mixed." (The audio concept of "mixers " notwithstanding.)

#2 will be perfect, of course, and is a kind of reference.

How well #1 represents #2 simply depends on how well you filter them. Some amount of the harmonics will get through the filters. It is that simple. Filters are not perfectly flat in the passband either. The fundamentals of #1 will have phase shifts due to the filters, so if you look at phase in a ddition to amplitude, there is that impairment too. One can't make a gener al quantitative statement unless you make specific filter definitions.

A "squarewave" has a 50% duty cycle, by definition. Other duty cycles use the more general term "rectangular wave."

The amplitude of the fundamental, and all harmonics plus DC, are affected b y duty cycle and DC offset. Thus filtered versions will simply represent t hose duty cycle + offset affected amplitudes. General FT/FS formulas for rectangular waveforms exist. They aren't too hard to solve either.

Reply to
Simon S Aysdie

It's a 'trick' question. What's the difference in frequecy content? Absolutely NONE. except for the higher harmonics of the square waves. The fundamentals are stated to be the same, so...

Reply to
RobertMacy

It's a 'trick' question. What's the difference in frequecy content? Absolutely NONE. except for the higher harmonics of the square waves. The fundamentals are stated to be the same, so...

Reply to
RobertMacy

It's a 'trick' question. What's the difference in frequecy content? Absolutely NONE. except for the higher harmonics of the square waves. The fundamentals are stated to be the same, so...

Reply to
RobertMacy

The only one who is confused is me. That's why I asked the question.

Klaus Jensen

Reply to
Klaus Jensen

Understood, apologies. Assume the 'mixing' process is linear, not mixer in the sense of RF, but Audio 'mixing'. What everybody said about doing simulations holds.

There are some basic principles that make doing FT's in your head easy. Very useful tool to 'envision' the results WITHOUT having to go through all those mind boggling equations. Basically remember MULTIPLICATION in one domain is CONVOLUTION in the other domain. And, time waveforms can be made up of simpler pieces. There's also a very useful concept, called an impulse function [impulse function is infinitely narrow, infinitely high, and has area of one]. A time impulse has a flat infinite spectrum of one, all the freuqencies, and an impulse in the frequency domain means you have DC at one, but no tones. A series of evenly spaced impulse functions is called a 'replicating' function, because it looks the same whether in time or frequency domain. Useful for exploring sampling time waveforms.

OK, compare the three pure sine waves to the three 'square waves' of same fundamental frequencies. AT the fundamental frequencies the three pure sine wave AND the three square waves are IDENTICAL. It's just that the sq waves have 'extra' content, harmonics above the fundamental tones.

One important detail is that time waveforms are all REAL, and FT Spectrum is COMPLEX. Time delay, or shifting along the time axis, as in moving from cosine to sine wave, affects the Frequency Spectrum but NEVER changes the magnitude along the axis, envision 'rotates' the complex angle. It's like holding a coiled spring and you twist it for time delay. Where a cosine wave makes a spike at +f and -f, but the sine wave spike 'counter rotates' Spikes keep their amplitude just start rotating around until +j on one side and -j on the other.

You asked about duty cycle's effect on the spectrum. You can easily do that as a mental exercise: single timepulse has a spectrum of sinc function replicating the square pulse, which is a convolution process in the time domain is multiplying in the frequency domain. By examination in the frequency domain, you can see the 'samples' are the fundamental, exactly zero, followed by a smaller negative peak, exactly zero followed by a smaller positive peak and so on. When the duty cycle is 50% these 'sample' points land EXACTLY on the crossovers and peaks of the sinc function. From that exercise you have the intercepts of the sinc function AND the sampling points for your replicating function. ALL without doing any math. As long as you don't change frequency, those replicating sample points stay put. However, what they sample will change as you change the duty cycle of your square wave.

Now make your single pulse narrower, which 'spreads out' the spectrum, still a sinc function. and convolve with that 'replicating' function. and that's like multiplying the replicating function in the Frequency Spectrum at different points along the sinc function! For a 25% duty cycle, you'll have fundamental, not too much smaller positive, smaller positive, zero, then negative, negative, negative, then zero, and so on. You can work it out for any weird duty cycle in between by doing this.

It is of interest that pure spike sample points provide the least distortion to a spectrum. Sample and hold for a while gets the sinc function in there and starts rolling down your highs near the Nyquist rate. And making the waveform 'pretty' by ramping between points is like convolving in the time domain which is multiplying the sinc function on itself and doing twice as much 'damage' to the high end.

All envisioned WITHOUT that mind boggling math.

Reply to
RobertMacy

Yes.

Many years ago, I had this snobbery about analysing everything to closed form. Complete waste of time. I realised that I am an engineer not a mathematician. The job is to get the right answers and produce product. Anything but the most simplest equation, is useless to design with. A spice simulation of a SMPS can take 10 secs. A theoretical analysis of all the bits and bobs could take 6 months. If in doubt, simulate. It clears up the unknown immediately.

Kevin Aylward

formatting link
formatting link
- SuperSpice

Reply to
Kevin Aylward

is COMPLEX.

It can be, but it isn't in this case. Taking the Fourier transform of a 50% duty cycle square wave doesn't actually generate any complex components.

It's a short-hand way of saying that you can decompose a 50% duty cycle squ are wave into the sum of series of sinusoids, starting with a sine wave of the same frequency as the square wave and the same amplitude, and progressi ng through the odd harmonics of that sine wave, with the amplitude of each harmonic inversely proportional to the harmonic number - that is the first odd harmonic, which is third, and thus at three times the frequency of the square wave, has one third of the amplitude.

Every harmonic has to go through zero where the parent square wave does, in the same direction, so there's no necessity for complex components.

Repetitive spikes don't generate a complex waveform either.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.