# Fourier series on incomplete data [closed]

Given a periodic function that's only partly specified, e.g.:

$$f(\theta)=\begin{cases}1 & \text{if } \cos(\theta)>a\\ -1 & \text{if } \cos(\theta)<-a\end{cases}$$

Obviously the ordinary Fourier transform won't do; I don't want a flat zero in the gaps. Can it be modified to give me the Fourier series I want, or must I resort to a series of least squares fits?

EDIT, April 28: Ideally what I want is a Fourier series such that each truncation to $n$ terms is, for those $n$ basis functions, the least-squares fit to the known segments. If that's not a reasonable thing to wish for, may I request suggestions of cy près substitutes?

## closed as unclear what you're asking by Yves Daoust, Daniel W. Farlow, Leucippus, zz20s, RamiroApr 25 '16 at 3:32

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• As the result you want to get the frequency spectrum? – werediver Apr 24 '16 at 20:10
• I'm not looking for a spectrum, really, just a pretty fit to the known segments. – Anton Sherwood Apr 24 '16 at 22:11
• Perhaps you bring up the notion of a modified Fourier series simply because you want a periodic fit. That is unnecessary. A "least squares fit" seems also beside the point since the known data can be used exactly. The gaps could be filled most simply with linear interpolation. If something smoother is desired, then monotone cubic interpolation. However you have said nothing to indicate what makes one interpolation more serviceable than another. – hardmath Apr 29 '16 at 1:02
• Sure, I could use the known data exactly and fit polynomials between. That's not interesting to me. I don't care about exact fits, I'm looking for graceful approximations with a high degree of continuity. – Anton Sherwood Apr 30 '16 at 6:37