# Smooth $f(x)$ where $f(x) = 1$ for $x = \pm 1, \pm 5, \pm 9, \ldots$ and $f(x) = -1$ for $x = \pm 3, \pm 7, \pm 11$

Question: Find smooth $f(x)$ where $f(x) = 1$ for $x = \pm 1, \pm 5, \pm 9, \ldots$ and $f(x) = -1$ for $x = \pm 3, \pm 7, \pm 11$

Condition: For the purpose of this question, I define smoothness as no sudden changes in the function and its fourier transform is finite in (band)width. For sync, the FT is rect function which has a finite width. I know that a rigorous definition of smoothness is lot more complicated - but please go with my notion for now.

Consider the top two curves in the picture below. The first one is the $\operatorname{sinc}(x) = \dfrac{\sin(\frac{\pi x}{2})}{(\frac{\pi x}{2})}$ function. It is smooth and has finite width in FT domain. It has same values for $\pm1$ and it alternates sign for $\pm3, \pm5$ and so on. But its value does not remain constant going from $\pm1$ to $\pm5$ to $\pm7,\ldots$ as per my Question. So this function doesn't satisfy my requirement.

The second one is a sine function multiplied by sign function. It satisfies the values I need, but since there is an abrupt change at $0$, its fourier transform is infinite in width. Hence this too doesn't satisfy my requirement.

I am looking for functions that are (only for visual example) like in the 3 bottom figures (that I have hand drawn with no particular mathematical accuracy). I am not particular about how the function should look like in between $-1$ to $+1$. It could be totally different looking than what I have shown, as long as it meets the requirements stated in my question (and condition). • Do piecewise functions satisfy your definition of smoothness? If yes, then it is easy to create such a function from the sin variant you have already tried. – shardulc says Reinstate Monica Jun 24 '17 at 1:02
• No, because piecewise functions tend to have infinite width in Fourier/frequency domain. – Srini Jun 24 '17 at 1:17

If piecewise functions are allowed, consider $$f(x) = \begin{cases} \operatorname{sgn}(x)\sin(\pi x/2) & : |x| \ge 1\\ \sin^2(\pi x/2) & : |x| < 1 \end{cases}$$