Optimally approximating the sign function by functions with compactly supported Fourier transform

I'm looking for a systematic way to approximate the sign function

$$sgn(x)=\begin{cases}1&\text{ if }x\geq 0\\-1&\text{ if }x<0,\end{cases}$$

by functions $$f$$ whose (distributional) Fourier transforms $$\hat{f}$$ are compactly supported.

More precisely, let us fix some $$\epsilon$$ small. Then I am interested in odd, continuous $$f$$ such that:

• $$\text{supp}{\hat{f}}\subseteq[-\pi,\pi];$$
• there exists some $$a_f>0$$ such that $$|f^2(x)-1|<\epsilon$$ whenever $$|x|\geq a_f$$.

Goal: I am looking for a "best" $$f$$ in the sense $$a_f$$ is as small as possible.

I figured that one way to do this would to be to look at convolutions $$f=a*sgn$$ where $$a$$ is a function that satisfies $$\int_\mathbb{R} a(s)\,ds=1$$ and $$\text{supp }{\hat{a}}\subseteq[-\pi,\pi]$$. For example, we could take

1. $$a_1(s)=\dfrac{\sin(\pi s)}{\pi s}$$; or
2. $$a_2(s)=\left(\dfrac{\sin(\pi s)}{\pi s}\right)^2,$$

where the Fourier transforms of $$a_1$$ and $$a_2$$ are a rectangular and a triangle pulse respectively.

Doing some numerical experiments, I find that for the choice $$\epsilon=0.05$$, $$a_2$$ is "better" than $$a_1$$ by the above criterion.

Question: Is there a more systematic way to find better (or a best) $$f$$? References that deal with this type of problem would also be appreciated.

• I assume you want a family of functions parameterized by some parameter k. How about $$y=\frac{e^{2k}x}{\sqrt{e^kx^2+1}}$$ Nov 2 '20 at 15:05
• You should maybe work with the Heaviside function, a close cousin of sign function... Nov 2 '20 at 15:07
• Have a look at the dsp "branch" of Stack Exchange, for example see this Nov 2 '20 at 15:13
• @JeanMarie Ah thanks, I'll take a a look! Nov 2 '20 at 15:20