How to make ANY function to repeat periodically?

7.6k Views Asked by At

I have some function, say, Gauss PDF

enter image description here

Now I want it to repeat, say, every N units

enter image description here

How to transform any function this way?

I know I can sum function at each shift. But is it possible to convert argument only? I.e. apply some transform to $x$ only?

UPDATE

Ideally, I would like to find $g_T(t)$ such that

$\sum\limits_{n=-\infty}^{\infty}F(t+nT) = F(g_T(t))$

where $n \in Z$, $F$ is any function and $T$ is desired period.

I don't know if it is possible in principle, for example, endless summing may produce infinities everywhere. In this case one may introduce some weighting in lefthand side...

UPDATE 1

My be lefthand size should be

$\lim\limits_{k \to +\infty}\frac{1}{2k}\sum\limits_{n \in Z}F(t+nT)$

2

There are 2 best solutions below

7
On

If you say $$p(x) = f(x\bmod N)$$

then $p$ is a periodic function with period of $N$, which has $p(x)=f(x)$ for all $x$ in $[0, N)$.

To make $p$ and $f$ agree on an interval that is symmetric around 0, you can use $$p(x) = f\left(\left(\left(x + \frac N2\right)\bmod N\right) - \frac N2\right)$$

which is again a function that has a period of $N$, but this time $p(x) = f(x)$ for all $x$ in $\left[-\frac N2, \frac N2\right)$.

If that's not what you want, please clarify what your question is.

0
On

A possible approach is to use a Fourier series expansion of the function.

Suppose that you want to repeat the function $f(x)$ on the interval $[-L,L]$ where $L=N/2$, with $N$ as specified in the OP.

The fourier series expansion from this interval is $$ f(x)=a_0+\sum\limits_{n=1}^\infty a_n\cos\left(\frac{n\pi x}{L}\right)+b_n\sin\left(\frac{n\pi x}{L}\right), $$ where $$\begin{align} a_0&=\frac1{2L}\int_{-L}^Lf(x)\,dx,\\ a_n&=\frac1{L}\int_{-L}^Lf(x)\cos\left(\frac{n\pi x}{L}\right)\,dx,\text{ and}\\ b_n&=\frac1{L}\int_{-L}^Lf(x)\sin\left(\frac{n\pi x}{L}\right)\,dx. \end{align}$$

Given that your function $f$ is even, we will have $b_n=0$ for all $n$.

These integals do not appear to be expressible in terms of ordinary functions (see WolframAlpha). Thus, for this approach, the integrals have to be numerically approximated, which could cause further numerical problems.