Continous, Non-Fourier, Trigonometric Approximation of the Floor Function

154 Views Asked by At

I would like to know a single (not piecewise) continuous approximation of $\mathbb{floor}(x)$ which gets sharper the more you increase a constant. I do not want a series like Fourier, but I do want something that uses trigonometric functions, as that is the only way this seems to be possible. Here is what I mean: enter image description here

It may be possible to find an approximation of $\mathbb{frac}(x)$, $f(x)$, then do $x-f(x)$

1

There are 1 best solutions below

5
On

The best I could come up with (without using Fourier), were piecewise functions. If it just needs to continuous we can use straight lines like this: $$ f(x,a) = \begin{cases} ax - (a-1)n - \frac12 & x\in(n-\frac 1{2a},n+\frac 1{2a}) \\ n & x\in(n+\frac1{2a}, n+1-\frac1{2a}) \end{cases} $$ for $n\in\mathbb Z$.

We can smooth it out with a trigonometric function if you want: $$ f(x,a) = \begin{cases} \left |\cos x\right|^a+n & x\in(n-\frac12,n) \\ n & x\in(n,n+\frac12) \end{cases} $$ Any S-shaped curve will do for the transition, really. To make it symmetric, we could use $\frac{1}{1+\exp(-\tan(ax))}$ (a composition of $\tan$ and the logistic function). Or we could base it on a bump function such as $\exp\left(-\frac{1}{1-(ax)^2}\right)$ with appropriate scaling and gluing-together.