1
$\begingroup$

A square wave is a sum of sinusoids so surely it should be represented as individual discrete impulses in the frequency domain, where all other frequencies are 0. Why instead are those intermediate frequency components not 0, and form a continuous sinc shape? I know that the continuous fourier transform of $A\text{rect}(\frac{t}{\tau}) = A\tau \text{sinc}(f\pi\tau)$, but why is this the case when you think about it in the first perspective?

$\endgroup$
  • $\begingroup$ Discrete vs continuous? They are not interchangeable. $\endgroup$ – Cedron Dawg Jul 20 at 12:20
  • $\begingroup$ Clarify what you mean by continuous? Do you mean continuous vs discrete or continuous as in the smoothness of the derivatives? $\endgroup$ – David Jul 20 at 12:44
6
$\begingroup$

As @Hilmar mentioned I think you get confused between Square wave and Rectangular function.

In Wikipedia about Square Wave :

A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency between fixed minimum and maximum values, with the same duration at minimum and maximum.

Which its Fourier Transform is only at harmonic frequencies and its value is equal to Fourier series coefficient.

but Rectangular Function:

The rectangular functionis defined as:

enter image description here

which look like this:

and its Fourier Transform is a sinc function that looks like this:

| improve this answer | |
$\endgroup$
  • $\begingroup$ Oh yes of course $\endgroup$ – Lewis Kelsey Jul 20 at 20:17
  • $\begingroup$ But the impulses are in the shape of a sinc nonetheless. I found this similar question: dsp.stackexchange.com/questions/34844/… $\endgroup$ – Lewis Kelsey Jul 20 at 20:24
  • $\begingroup$ @m-sh-shokouhi The Fourier Transform of a periodic square wave is not a stream of impulses as you show in the second figure.Those impulses would be weighted by the Sinc function, resulting in odd harmonics for a 50% duty cycle square wave since the even harmonics will fall in the nulls of the Sinc. $\endgroup$ – Dan Boschen Jul 21 at 2:08
  • 1
    $\begingroup$ @DanBoschen I agree with you. I will correct it. $\endgroup$ – m-sh-shokouhi Jul 21 at 2:11
3
$\begingroup$

Depends on what you mean by "square wave".

A single rectangular pulse has indeed a sinc spectrum

An infinitely repeating series of rectangular pulses has a line spectrum with discrete frequencies

| improve this answer | |
$\endgroup$
3
$\begingroup$

A square wave is not a Sinc function in the frequency domain, but a sampled Sinc function (Even as a continuous function, the non-zero values are samples of the Sinc function in frequency). An individual rectangular pulse is a continuous Sinc function. The difference is the former is repeating in time. Repetition in one domain relates to sampling in the other domain.

This property holds for any repeating pattern. The envelope will be the Fourier Transform of the base shape, and then when repeating, non-zero frequency values will only exist at integer multiples of the repetition rate. This is demonstrated with two variants of a repeating pulse below, the first with a 50% duty cycle and the second with a 25% duty cycle. The pulse has a Fourier Transform as a Sinc function with the first nulls at $1/T$ where T is the pulse width (in this case 0.05 seconds and 0.025 seconds), while the pulse is repeating at a 10 Hz rate in both cases. The red trace is the Fourier Transform of the pulse (a Sinc) while the impulses shown are the non-zero frequency components.

enter image description here

enter image description here

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ @LewisKelsey When you repeat anything it MUST be discrete in frequency; a continuous frequency spectrum can’t exist (unless you allow zero values). This is clear by studying the Fourier Series Expansion where it is clear that you can’t possibly reconstruct the signal, and have it repeat, unless every harmonic similarly repeats over that cycle. So this propery can be carried to any fundamental shape — the transform will have the envelope of that shape but the frequencies can only exist (as non-zero values) at harmonics of the repetition rate $\endgroup$ – Dan Boschen Jul 22 at 23:47
  • 1
    $\begingroup$ @Lewis Also not sure if this helps you or not but you can completely swap the domains which sometimes provides more intuition. For example, if you are familiar with sampling in time (A/D and D/A conversion) and how that creates periodicity in frequency: it's the same exact relationship so more generally Sampling in one domain is Periodicity in the other domain. $\endgroup$ – Dan Boschen Jul 23 at 12:06
  • 1
    $\begingroup$ Yes in this case if the time domain waveform is symmetric about 0 (non causal) the phase will only be 0 and 180 in frequency (frequency will only be real) but in general cases it would be complex in which case we would plot magnitude (all positive) and phase separately. If you haven’t already I think it would be instructive for you to work out the Fourier Series Expansion of sich a repeating pulse (start with a square wave to see how you only get the odd harmonics). Do the reconstruction from the harmonica back to time manually to see how the square wave gets reconstructed— $\endgroup$ – Dan Boschen Jul 25 at 13:28
  • 1
    $\begingroup$ Then try any other frequency in the reconstruction to see how that possibly can’t work and it should all be clearer. Also keep in mind that the Fourier Series Expansion of a waveform over finite time 0 to T (or -T/2 to +T/2) is identical to the infinite duration waveform with that original waveform periodically repeating in time. Doing this exercise I suggest will make that clearer too $\endgroup$ – Dan Boschen Jul 25 at 13:30
  • 1
    $\begingroup$ If you want to know why this is true work through the math but a GREAT example is Euler's formula for sine and cosine (both real functions!). What are they in the frequency domain? Symmetric/assymetric real/complex? $\endgroup$ – Dan Boschen Jul 26 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.