Solution (source code)

= Solution

Fourier transforming the refinement equation and changing variables gives
$$
f(2t)=m(t)f(t),\qquad
\boxed{m(t)=\frac12\sum_na_ne^{-int}}.
$$
By <Parseval identity>, orthonormality of the translates is equivalent to
$$
\frac1{2\pi}\int_{\mathbb R}|f(t)|^2e^{int}dt=\delta_{n0}.
$$
These are precisely the Fourier coefficients of the periodization $P(t)=\sum_k|f(t+2\pi k)|^2$. Therefore
$$
\boxed{\{\phi(\cdot-n)\}\text{ is orthonormal}\iff
\sum_k|f(t+2\pi k)|^2=1\ \text{a.e.}}
$$