# Describing a Wave

I have this wave in front of me, and I am to describe this into a math description such as its function that is equivalent to representing this wave. I have no idea how to start and could use some detailed guidance if possible, or just how to go about getting an expression for it, as well as finding the amplitude, phase, ... etc.

The picture of the waveform is below:

-
Are you familiar with the sinusoid? en.wikipedia.org/wiki/Sine_wave – leonbloy Sep 11 '11 at 3:09
@night_owl : I guess what you are looking at is most probably a binary wave modulated under the digital modulation scheme of PSK (phase shift keying). This is used in digital communications to transmit information (binary) over a band pass noisy channel. more on PSK can be read here : en.wikipedia.org/wiki/Phase-shift_keying – Rajesh Dachiraju Sep 11 '11 at 11:01

$$-\sin\left(8\pi\left|x-2\left\lfloor\frac{x}{2}\right\rfloor-1\right|\right)$$ seems to work...

How to make your own periodic function

Questions like this or this keep turning up here, so for completeness, I'm documenting a recipe for constructing periodic functions.

The first thing you need to do is to figure out your "repeating unit"; that is, you should have some function $f(x)$ defined over some interval $[a,b]$ as a starting point, such that the final function is a periodically extended version for $x$ outside the interval $[a,b]$. (I will be assuming for the rest of this answer that $f(a)=f(b)$; otherwise, as with this answer, some care and finesse is required if the behavior at the function's jump discontinuities matters to you.)

The key ingredient for making your custom periodic function is the sawtooth, i.e. the function $x-\lfloor x\rfloor$. This has the property that it is equal to $x$ in the interval $[0,1)$, and repeats thereafter.

From this, the basic sawtooth can be rescaled and translated like so:

$$x-(b-a)\left\lfloor\frac{x-a}{b-a}\right\rfloor$$

This function now has the property of being equal to $x$ within the interval $[a,b)$, and repeats thereafter. Thus, if you want your function to be a repeated version of the function $f(x)$ over the interval $[a,b]$, and $f(a)=f(b)$,

$$f\left(x-(b-a)\left\lfloor\frac{x-a}{b-a}\right\rfloor\right)$$

is the desired periodic function.

Alternatively, since

$$x\bmod y=x-y\left\lfloor\frac{x}{y}\right\rfloor$$

the modulo function can also be used to represent the sawtooth.

(For some purposes, one might need to multiply the periodic function thus obtained with an appropriate square wave factor like in Zev's answer to the semicircle question, but I shan't be considering that filigree here.)

Going back to the OP's problem, consider the function $-\sin(8\pi |x|)$ (alternatively, $-\mathrm{sign}(x)\sin(8\pi x)$):

This looks very much like one period of the OP's required function, except that it is defined over the interval $[-1,1]$ and not over $[0,2]$. A translation fixes that: $-\sin(8\pi |x-1|)$. One now replaces the $x$ with a sawtooth over $[0,2)$ like so:

$$-\sin\left(8\pi\left|\left(x-(2-0)\left\lfloor\frac{x-0}{2-0}\right\rfloor\right)-1\right|\right)$$

and simplifying that yields the function I gave earlier.

-
J.M. +1... Very nice thought there. What made you see this?, using the tool of the floor function. Which part of the floor actually affects the wave? – night owl Sep 11 '11 at 4:22
I'll write something up later; I really should be documenting my recipe for constructing periodic functions anyway... – J. M. Sep 11 '11 at 4:25
Very much appreciated and as you should for referring back to. We could all learn and benefit from different methods for accomplishing the same results. :) – night owl Sep 11 '11 at 4:31

It looks like 4 sine wavelengths, then another 4 upside down, 4 more right side up, and then 4 upside down, all scrunched up into the interval $[0,4]$. It repeats every interval of length $2$, so that's the period, and the amplitude can be seen from the graph as $1$. First what we'll do is dilate $\sin$ to accommodate 4 full wavelengths in $[0,1]$: this is simply $\sin(8\pi x)$ (this follows because $2\pi$ divided by $1/4$ is $8\pi$). Then we'll multiply this by a function which is $+1$ on $[0,1)$, $-1$ on $[1,2)$ and so forth: this is just the square wave stretched by a factor of 2, or $S(t/2)$. Hence the function is $$x(t)=\sin(8\pi t)S(t/2).$$

Wolfram Alpha shows this is correct:

-
The $S(t/2)$ factor is replaceable with $(-1)^{\lfloor x\rfloor}$ or $\mathrm{sign}(\sin(\pi x))$, among other things... – J. M. Sep 11 '11 at 4:21
Anon, Brilliant! I did not see this with the use of the square wave. Ingenious answer. I was thinking its some sine wave of some angular frequency * some function to get that negative part of the wave. But very nice. How did you analyze this so fast? :) I'm just curious. hehe – night owl Sep 11 '11 at 4:26
@night owl: A little bit of experience goes a long way, I guess. With analyzing waves it frequently (pun intended) comes down to decomposing into additive, multiplicative and stretching factors. – anon Sep 11 '11 at 4:54
Anon, how would you adjust the factor $8$ and others if needed, to accommodate for the time axis being $4$ms instead of $4$? – night owl Sep 12 '11 at 8:03
@night: If you desire a period of $L$, then you want $\sin(\frac{2\pi}{L}x)$. Check that adding $L$ to $x$ leaves the value unchanged. In the above we wanted the $\sin$ component to have a period of $1/4$. – anon Sep 12 '11 at 8:13

So the phase looks like increasing and then reversing its direction and decreasing in the same manner. So phase change looks like a "triangle wave". According to this, I think you can write it as $$\sin( \arcsin( \sin (x)))$$ I am not sure about the triangle wave formula, wiki has something different but you can correct it yourself.

EDIT : I think this link is better than the previous one.

EDIT2 : It doesn't work, see Anon's answer.

-
Those are piecewise linear, unlike OPs waveform. – anon Sep 11 '11 at 3:23
@anon: Yep, that doesn't work but OP's waveform has a piecewise linear "phase". $\sin{\theta}$ where $\theta$ is starting from zero for some duration and then unwrapping back to zero. – user13838 Sep 11 '11 at 3:39
@anon: bah, nevermind you already got it :) – user13838 Sep 11 '11 at 3:40
Heh heh ;) Edit: Oh, I see what you're saying. – anon Sep 11 '11 at 3:43
Percusse, thanks. I see where you were trying to go with this but thanks anyway. This is an insightful way to think of it and I will see if I can finish what you started. :) – night owl Sep 11 '11 at 4:13