Suppose $u : \mathbb R \to \mathbb C$ is a smooth, (Bohr) almost periodic function. Formally, such a function admits a Fourier series expansion
$$u(x) = \sum_{\lambda \in \Lambda} \widehat u(k) e^{i \lambda x}$$
for some countable frequency set (sometimes known as the spectrum; one can in some sense think of this as the Fourier support) $\Lambda \subseteq \mathbb R$, which, for the sake of generality, we take to be a $\mathbb Z$-module, i.e. closed under addition, subtraction, and contains the zero frequency. To be concrete, let us suppose $\widehat u(\lambda) \in \ell^1(\Lambda) \cap \ell^2(\Lambda)$.
I am interested in seeing whether there is a "nice" sub-class of almost periodic functions for which one has the estimate
$$||u||_{L^\infty} \lesssim ||\widehat u||_{\ell^2}.$$
Without any restrictions, one can consider a sequence of the form
$$u_n (x) := \sum_{k = 1}^n \frac1k e^{i \lambda_k x},$$
for, say, frequencies localised to $\lambda_k \subseteq[1/2, 1]$. Then evidently $u_n(0) \to \infty$ however $||\widehat{u_n}||_{\ell^2} \lesssim 1$. More dramatically, the derivatives are also uniformly bounded $||\lambda \widehat{u_n}||_{\ell^2} \lesssim 1$, which shows that any form of Sobolev embedding fails. From this example, it seems that there are two main enemies:
- concentration of mass near a single frequency; for periodic functions the mass is spread out discretely in frequency space so derivative control translates to decay of high frequencies,
- "resonant" Fourier coefficients in the sense that they all have the same phase, so at $x = 0$ there is no cancellation.
I am not sure how fatal the first enemy is, while for the second I know that there are some results which state that coefficients with "randomly" distributed phases (or signs in the real-valued setting) lead to some cancellation in the periodic setting, though I am not familiar with any quantitative estimates in this direction or results for almost periodic functions.