48
$\begingroup$

I discovered unexpected patterns in the plot of the function

$$f(x) = \sin(a\ x^2)$$

with $a = \pi/b$, $b=50000$ and integer arguments $x$ ranging from $0$ to $100000$. It's easy to understand that there is some sort of local symmetry in the plot but the existence of intricate patterns like these

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

astonished me.

Is there a somehow simple explanation of these regular patterns that emerge when combining such "incommensurate" functions like $\text {sine}$ and squaring? Especially of their specific shapes, their increasing distinctness and the distances between them?


Added: This pattern I found only today somewhere in the middle of the plot:

enter image description here

Do you see the "corridors"?

enter image description here

They long for explanation.

$\endgroup$
  • $\begingroup$ Is the elementary-number-theory tag appropriate? $\endgroup$ – Improve Apr 20 '17 at 16:34
  • $\begingroup$ Obviously not - it has been deleted. But the question has to do with (regularily distributed) natural numbers. $\endgroup$ – Hans-Peter Stricker Apr 20 '17 at 17:00
  • $\begingroup$ Is there some reason for you being using "unicode" to write superscript in the title and not using simple formatting ? $\endgroup$ – A---B Apr 20 '17 at 17:01
  • $\begingroup$ No. Thank you for having corrected it. $\endgroup$ – Hans-Peter Stricker Apr 20 '17 at 17:11
  • $\begingroup$ My answer explains the presence of the pattern in the shape of $\sin (ax^2+\phi)$. And when $x$ gets larger and larger, the points create "accidental" patterns. $\endgroup$ – Yves Daoust Apr 26 '17 at 14:00
68
$\begingroup$

This is the phenomenon known as aliasing, caused to the fact that you are sampling a fast-varying signal with a too low frequency. It tends to create replicas of the original signal, but dilated in time.

When $a$ is close to $2m\pi$, we have at integers

$$\sin an^2=\sin(a-2m\pi)n^2$$

which is a replica of the original function with the smaller coefficient $a'=a-2m\pi$, and this is similar to a time dilation with

$$n'=\sqrt{\frac{a'}a}n$$ so that

$$\sin an^2=\sin an'^2.$$

As you can check on the plot, the blue and green curve coincide at integers ($a=6, a'=6-2\pi$).

enter image description here

The other patterns are similarly obtained with a phase shift (such as the values at half-integers, corresponding to $\cos a'n^2$).

$\endgroup$
  • 2
    $\begingroup$ @HansStricker No, they coincide exactly at integers. $\endgroup$ – Yves Daoust Apr 20 '17 at 13:36
  • 8
    $\begingroup$ The point is that the computer graphs the curves by sampling them at regular points, and then it simply connects the dots of the samples. So the curve you see from the samples is going to miss all the extra wiggles between consecutive samples. Effectively it will have the lowest possible aliased frequency of the original. Sufficiently high sampling and sufficiently high screen resolution will counteract this, but with a signal like sin(x^2) whose frequency goes to infinity, there will always be at least some aliasing on a digital display. $\endgroup$ – Paul Apr 20 '17 at 14:43
  • 1
    $\begingroup$ I told the computer to sample only at regular points. That was part of the game. And there was no connecting of dots at all. And it has nothing to do with digital displays. (Open syspedia.de/sin_square.html and zoom-in with Ctrl-PLUS and you will see what I mean.) $\endgroup$ – Hans-Peter Stricker Apr 20 '17 at 14:50
  • 2
    $\begingroup$ The patterns you are seeing are aliased frequencies. It's not necessary to connect dots or have a digital display to see patterns corresponding to aliased frequencies. The discrete points form a shape that your eye is following and you are calling a pattern. That shape/pattern is an aliased frequency. Some of your graphs seem to show more than one aliased frequency. This is also possible, especially since you are controlling the sample rate explicitly and not a digital display. $\endgroup$ – Paul Apr 25 '17 at 13:32
  • 1
    $\begingroup$ This is not an explanation a layman can immediately understand: How can a pattern (something complex) be a frequency (a number)? $\endgroup$ – Hans-Peter Stricker Apr 25 '17 at 14:42
6
$\begingroup$

[To check it all out, you may want to visit this interactive page.]

There are several aspects of the plot of $f(x) = \sin(a x^2)$ for integer arguments $x$, that need explanation, especially

  1. its periodicity

  2. the symmetry of the period

  3. its recurring patterns

All these can be explained straight forwardly in a similar way:

Periodicity

enter image description here

$$\sin(a x^2) = \sin(a (c + x)^2) = \sin(a (c^2 + 2cx + x^2)) = \sin(ac^2 + 2acx + a x^2) =\sin(a x^2)$$

if $ac^2 = 2\pi m$ and $ac = \pi$ when $x$ is an integer. With $a = \pi/b$ this is fulfilled for $c = b$, provided $b$ is even. Here, $b=500$.

Symmetry of the period

enter image description here

$$\sin(a x^2) = \sin(a (b - x)^2) = \sin(a (b^2 - 2bx + x^2)) = \sin(ab^2 - 2abx + a x^2) = \sin(a x^2)$$

Recurring patterns

The most prominent recurring pattern is the first peak of $f(x) = \sin(a x^2)$, e.g. for $b = 5000$:

enter image description here enter image description here enter image description here

Let's take as an example the third of these patterns which is found exactly in the middle of the period of $f(x) = \sin(a x^2)$, i.e. at $x_0 = b/2$.

Enlarged, it looks like this:

enter image description here

We find:

$$\sin(a (2x)^2) = \sin(a (x_0 + 2x)^2) = \sin(a (x_0^2 + 4x_0x + 4x^2)) = $$

$$\sin(ax_0^2 +4ax_0x + 4ax^2) = \sin(\pi b/4 + 2\pi bx + 4a x^2) = \sin(4a x^2)$$

which holds when $b$ is divisible by $8$. A similar calculation shows that in this case

$$\sin(a (2x+1)^2) = -\sin(a (x_0 + 2x+1)^2)$$

This is still not the whole story to be told, but a beginning.

$\endgroup$
1
$\begingroup$

I found aliasing in a log table. Just use Excel to plot the error in a four place table with E(x)= Round(Log(x),4)-Log(x) for all 9000 values from 1 to 10. The values of the error will vary from -0.5E-4 ro +0.5E-4. The plot will have white vertical stripes where the slope of the log function is 1/4, 1/5, etc.

enter image description here

$\endgroup$
  • $\begingroup$ Could you please shortly explain why this is so? $\endgroup$ – Hans-Peter Stricker Apr 26 '17 at 13:51
  • 1
    $\begingroup$ When the slope of the log function is just right, several successive values of the error are the same. This prevents the plot from filling the space and creates the white stripes you see at about 8.7, 7.2, 6.2, 5.4, etc. Something similar can happen with almost any differentiable function. $\endgroup$ – richard1941 Apr 28 '17 at 5:50

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.