  We consider the problem of the maximum concentration in a fixed measurable
subset $\Omega\subset\mathbb{R}^{2d}$ of the time-frequency space for functions
$f\in L^2(\mathbb{R}^{d})$. The notion of concentration can be made
mathematically precise by considering the $L^p$-norm on $\Omega$ of some
time-frequency distribution of $f$ such as the ambiguity function $A(f)$. We
provide a positive answer to an open maximization problem, by showing that for
every subset $\Omega\subset\mathbb{R}^{2d}$ of finite measure and every $1\leq
p<\infty$, there exists an optimizer for \[
  \sup\{\|A(f)\|_{L^p(\Omega)}:\ f\in L^2(\mathbb{R}^{d}),\ \|f\|_{L^2}=1
  \}.
  \] The lack of weak upper semicontinuity and the invariance under
time-frequency shifts make the problem challenging. The proof is based on
concentration compactness with time-frequency shifts as dislocations, and
certain integral bounds and asymptotic decoupling estimates for the ambiguity
function. We also discuss the case $p=\infty$ and related optimization problems
for the time correlation function, the cross-ambiguity function with a fixed
window, and for functions in the modulation spaces $M^q(\mathbb{R}^{d})$,
$0<q<2$, equipped with continuous or discrete-type (quasi-)norms.
