Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One can define an analogous transform to the Fourier transform that uses square waves as the basis instead of sinusoids. Everything seems to work out in parallel and I imagine one can even come up with a FFT analogue.

We can define the square wave functions in a number of ways. The most direct seems to be

$$sq(t) = { 1 \mbox{ if } \frac{\{t\}}{2\pi} < 0.5, \mbox{ else} -1 }$$ $$cq(t) = sq(t + \pi/2)$$

here $sq(t)$ and $cq(t)$ are analogous to $sin(t)$ and $cos(t)$ resp.

The spectrograms are almost identical(well, there is some artifacting in the square wave case) and I was thinking they would be drastically different(the square wave case being more condensed).

Anyone think they can come up with an FFT version or have some fast hardware they could do some computations of various test cases and send me the spectrums if they are different? Or anyone can prove that they should be identical(or close)?

I am using

$$\int f(\tau) w(t - \tau) (cq(\tau) + isq(\tau)) d\tau$$

as the transform.

share|cite|improve this question
I would think it would be worse for things like Gibbs phenomena as it represents a zero-hold. – Mikhail Jan 26 '12 at 10:23
A better idea for defining the square wave: why not take $\mathrm{sign}(\sin\,x)$? – J. M. Jan 26 '12 at 10:41
Misha: The square transform would be worse for representing continuous function because it takes an infinite number of square waves. OTH, sin waves are worse to represent square waves as they take an infinite number. There is a huge difference though when one allows the amplitude to depend on time. In this case square ways can precisely represent any continuous wave quite easily but sin waves will require the amplitude to be infinite in some cases(the difference between 0/x and x/0). One can see this by noting that sq(t) = sin(t)/abs(sin(t)) (almost anyways) but sin(t) = abs(sin(t)). sq(t) – Uiy Jan 26 '12 at 12:38
J.M. As I said, there are a number of ways to do it. Using sgn(sin(t)) is more complex since it still requires evaluation of the sinusoid in a computation. It only has a theoretical advantage in some cases. It is identical of course. It has has the issue of how to define sgn. It's moot though how you define them. – Uiy Jan 26 '12 at 12:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.