Home > Tracks >

In Search of the Fourth Wave

Allen Downey - Watch Now

When I was working on Think DSP, I encountered a small mystery.  As you might know:

  1.  A sawtooth wave contains harmonics at integer multiples of the fundamental frequency, and their amplitudes drop off in proportion to 1/f.  
  2. A square wave contains only odd multiples of the fundamental, but they also drop off like 1/f.  
  3. A triangle wave also contains only odd multiples, but they drop off like 1/f².

This pattern suggests that there is a fourth simple waveform that contains all integer multiples (like a sawtooth) and drops off like 1/f² (like a triangle wave).  Do you know what it is?

In this talk, I'll suggest three ways we can solve this mystery and show how to compute each of them using Python, NumPy, and SciPy.  This talk is appropriate for beginners in both DSP and Python.

italicssurround text with
boldsurround text with
**two asterisks**
or just a bare URL
surround text with
strikethroughsurround text with
~~two tilde characters~~
prefix with

Score: 0 | 3 weeks ago | 1 reply

Is it possible to have the slides of this presentation? Thanks.

Score: 0 | 3 weeks ago | no reply

The Jupyter notebook is the slides. I used RISE to display the notebook in slide format. You can run the notebook here: https://tinyurl.com/mysterywave

Score: 0 | 3 weeks ago | no reply

this is awesome one

Score: 0 | 4 weeks ago | 1 reply

Very cool talk! I can't help but point out though, the complex exponential at 23:30 is missing the imaginary constant i or j!

Score: 0 | 4 weeks ago | no reply

Yes, I noticed that during the playback of the talk. It's fixed now in the slides. Thanks for letting me know!

Score: 2 | 1 month ago | no reply

The sawtooth & square wave spectra fall off as 1/f since the wave has discontinuities in the series itself (in the continuous representation); the spectrum of the triangle wave drops as 1/f^2 since the discontinuities are in the first derivative.

Score: 2 | 1 month ago | no reply

Very enjoyable talk Allen, much appreciated, will check out your blog and your ThinkDSP book.

Score: 1 | 1 month ago | 1 reply

Why did you pick the parabola-looking wave, instead of the sine-ish looking wave as the representative shape?

Score: 0 | 1 month ago | 1 reply

No special reason other than the shape was recognizable as a parabola, which led me to Method 3. And then the integration property tells us that the parabola is the integral of the sawtooth.

Score: 0 | 1 month ago | no reply

personally, i'm "partial" to the leaning-sine :)

Score: 2 | 1 month ago | 1 reply

How about all even harmonics? :)

Score: 1 | 1 month ago | no reply

Interesting question. I guess that would be the fundamental at 1000 Hz plus harmonics at 2000, 4000, 6000, etc. Not sure what that would look/sound like. I guess that'll be next year's talk.

Score: 1 | 1 month ago | 1 reply

13:07 sounds distorted

Score: 0 | 1 month ago | no reply

I think we picked up a delayed copy of the wave from my speakers to my mike, so there's some interference.