| Electronics > Projects, Designs, and Technical Stuff |
| Square wave harmonic content |
| << < (5/6) > >> |
| taydin:
--- Quote from: 2N3055 on September 28, 2019, 05:33:42 pm ---I cannot depict whether you are making fun of us or you are serious... --- End quote --- I don't see what's funny so far, but anyway, I have no desire of making fun of you. |
| T3sl4co1l:
Yes, I see. You are asking the wrong question. There is not even any meaning to the question "what causes a sine wave" -- a sine wave is eternal, without beginning nor end! You can no more ask "what causes a sine wave" than you can ask of God, "what created You?" Indeed, since all physical signals are by definition finite, on a sufficiently pedantic level, the Fourier transform (and all other infinite-time transforms) are somewhere between useless (they can never truly represent a real signal) and nonsensical (how can you ever integrate into even the finite future, let alone infinite?). But we nonetheless find them a useful representation, as others have illustrated through example. :) So what's so wrong with that? Perhaps your mind is too accustomed to causation, to procedure -- procedural computer programming for instance is exclusively causative; it is also nonreciprocal, or irreversible: a transfer of data from one function to another, does not cause a necessary change in the source. It is simply that, other systems have more complicated rules, rules like superposition (a signal can be represented as a sum of any infinite number of possible components, so long as the total ends up the same), reciprocity (you cannot deliver voltage to a load, without also drawing current from the power supply) and so on. Open your mind to these possibilities, and most of all -- work some problems dealing with this very subject. In time you will gain understanding. Tim |
| tggzzz:
--- Quote from: taydin on September 28, 2019, 05:42:54 pm --- --- Quote from: RoGeorge on September 28, 2019, 05:24:51 pm ---Yes, there are A LOT of sinusoidals in the square wave. You CREATED them, all at once, when you turned your switch on through your resistor. They ARE really there, they are real. You can look at each of those components with an adjustable bandpass filter. --- End quote --- So can we say that the rising edge and the falling edge of the square wave implement a change of energy which resembles one half of multiple sine waves (the first 90 degrees). The bandpass filter will just act on these partial sine waves and produce the necessary output? --- End quote --- No, you can't say that. |
| rstofer:
For giggles, I created two FFT displays with my Analog Discovery 2. Both are 1 kHz, 50% duty cycle with 1V amplitude (2V P-P) but one has a DC offset of 1V and in the FFT there is a DC component. The one without the offset (square wave is symmetric with respect to 0V), there is no DC spike. I rescaled so the two plots don't share a common vertical axis. Mostly because of the magnitude of the DC spike. The important thing to note is the fact that the square wave contains odd harmonics only and they extend from DC to Daylight with diminishing amplitudes proportional to 1/<harmonic number>. As we get higher in harmonics, the amplitude doesn't change as much from one harmonic to the next. Think about the 101st and 103rd harmonic. The amplitude factors are 1/101 and 1/103 0.0099 and 0.0097 - not much change. The 'squarish' waveform in the MOSFET circuit contains a bandwidth limited waveform. It will have odd harmonics out to some point where the low pass filter just attenuates them so much that the waveform loses its square appearance. Think in terms of pushing a 100 MHz squarewave through a 100 MHz scope. All you get is a sine wave with, perhaps, a wee bit of distortion. The 3rd harmonic is well beyond the capability of the scope and the 5th, 7th, and so on, are all essentially zeroed out. |
| T3sl4co1l:
--- Quote from: taydin on September 28, 2019, 05:42:54 pm ---So can we say that the rising edge and the falling edge of the square wave implement a change of energy which resembles one half of multiple sine waves (the first 90 degrees). The bandpass filter will just act on these partial sine waves and produce the necessary output? --- End quote --- If you insist on operating exclusively with edges, we can still perform the analysis; you're just forcing yourself into a corner which is more difficult to work in -- but which, trust me, is no less mathematically rigorous. :) To wit: we start with the Heaviside step function u(t). This is defined as zero for t < 0, one for t > 1, and conventionally 0.5 at exactly t = 0, but that doesn't really matter. The Fourier transform of this function is \$\frac{- j}{2 \pi}\frac{1}{\omega}\$. Don't mind the imaginary unit j -- that just sets the phase, and shows that the phase for \$\omega < 0\$ is positive (+90°), and negative (-90°) else. This is a standard consequence of real-valued signals, actually: that the transform is Hermitian, i.e., the imaginary sign flips when the argument (omega) flips. (I think that's right? I always forget which, or if it's that it's an odd function.) Note, by the way: this function has considerable power, indeed infinite energy around zero frequency (again, the rate of energy is power; such a function does indeed exhibit power, though only at DC. Which is to be expected, since, well, it's the purest case of "pulsed DC"!) It has very little energy at high frequencies, and does not contain discrete frequencies, but rather a continuum. Suppose we add another edge, another unit step, time shifted and opposite in phase -- so we get a single rectangular pulse instead. What then? We apply the time-shift identity, which multiplies the transformed function by \$e^{j \omega t}\$ for a time-shift of t. I will leave it as an exercise to the reader to prove, but the result is sinc(omega) = sin(omega) / omega. Give or take phase, since the rect(t) function gives sinc(omega) but rect(t) is centered around zero by convention. But anyway, this is just one of many handy complementary functions we learn about. What if there's an infinite series of steps, thus making a square wave? The oscillation of the sinc function continues to be reinforced by interference; in fact, at infinity, the interference is so strong that the only peaks left are infinitesimal in width (usually written \$\delta(\omega)\$). And there's an infinite series of them, and their amplitudes happen to go as 1/N. We might simplify this and instead write the original function as a sum of sines or cosines, with their amplitudes and phases given by this solution. Then we can dispose of that nasty delta impulse function, and get the Fourier series representation. So, after all this process -- In the iterative sense, we have "caused" sine waves to exist, by using an infinite series of equally spaced, complementary edges. Although, say you wrote a program that adds up infinite edges and finally calculates its transform -- it can never finish. So again, it isn't very meaningful to "cause" this to be, if it can never be computed directly, say. What caused the universe to exist, or God (if you are of a religious sort -- take most world religions* for example on this one)? It isn't a meaningful question; they simply exist. *Interestingly, several major ones teach a (finite) beginning to the universe, or to their god(s), putting a more human (finite) touch on things than the western Abrahamic ones do. Perhaps a theological analogy isn't the best after all. :) Tim |
| Navigation |
| Message Index |
| Next page |
| Previous page |