# In Search of The Fourth Wave

Last year I participated in the first DSP Related online conference, where I presented a short talk called "In Search of The Fourth Wave". It's based on a small mystery I encountered when I was working on *Think DSP*. 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 the talk, I suggest four ways to solve this mystery, and in the Q&A, one of the attendees suggests a fifth.

You can watch the talk here:

And you can run the Jupyter notebook on Colab by clicking here.

- Comments
- Write a Comment Select to add a comment

Which was the suggested 5th method?

Convolving a square wave with itself.

Great video!

What exactly do the command "wrap" do?

As in;

def parabola_func(cycles):

ys = wrap(cycles) - 0.5

return ys**2

I am trying to find the C/C++ equivalent, thanks

It's defined in the notebook (https://colab.research.google.com/github/AllenDown...)

def wrap(cycles):

frac, _ = np.modf(cycles)

return frac

`wrap` uses `modf` to compute the fraction part of the number of cycles.

Should be easy enough to translate!

To post reply to a comment, click on the 'reply' button attached to each comment. To post a new comment (not a reply to a comment) check out the 'Write a Comment' tab at the top of the comments.

Please login (on the right) if you already have an account on this platform.

Otherwise, please use this form to register (free) an join one of the largest online community for Electrical/Embedded/DSP/FPGA/ML engineers: