Home >

## In Search of the Fourth Wave

Allen Downey - **Watch Now!**

**This talk will be followed by a Live Q&A Discussion on Zoom.**

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

- A sawtooth wave contains harmonics at integer multiples of the fundamental frequency, and their amplitudes drop off in proportion to 1/
*f*. - A square wave contains only odd multiples of the fundamental, but they also drop off like 1/
*f*. - 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.

**Puru**

**Leandro**

Hello,

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

**AllenDowney**Speaker

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

**robertdown**

this is awesome one

**MrFox**

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!

**AllenDowney**Speaker

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

**doc_cls**

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.

**CoryClark**

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

**TheBOOM**

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

**AllenDowney**Speaker

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.

**TheBOOM**

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

**TheBOOM**

How about all even harmonics? :)

**AllenDowney**Speaker

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.

**TheBOOM**

13:07 sounds distorted

**AllenDowney**Speaker

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

Nice explanation covering most of the DSP topics