I am currently interpolating the step between two functions from $-1$ and $1$ smoothly therefore I used $\tanh$. Since I am quite confident with the result, but interested in further ways to do this, I am asking you the following.
So the question is:
I am looking for a sequence of functions $f_n$ that interpolates between $-1$ and $1$ and convergence for $n \to \infty$ against the step-function.
Probably some Fourier series will also be possible, but I was unable to construct one.
Using the error function $\mathrm{erf}$, try $f_n(x)=\mathrm{erf}(nx)$. Then each $f_n$ is $C^\infty$ and, when $n\to\infty$, $f_n(x)\to-1$ if $x\lt0$ and $f_n(x)\to1$ if $x\gt0$.