We study how the coherence of noisy oscillations can be optimally enhanced by external locking. Basing on the condition of minimizing the phase diffusion constant, we find the optimal forcing explicitly in the limits of small and large noise, in dependence of phase sensitivity of the oscillator. We show that the form of the optimal force bifurcates with the noise intensity. In the limit of small noise, the results are compared with purely deterministic conditions of optimal locking. Autonomous self-sustained oscillations may be extremely regular (like, e.g., lasers) or rather incoherent (like many biological oscillators, e.g., ones responsible for cardiac or circadian rhythms). A usual way to improve the quality of oscillations is to lock (synchronize) them by an external pacing [1,2]. This is used in radiocontrolled clocks and in cardiac pacemakers; also circadian rhythms are nearly perfectly locked by the 24-hours day/night force.In this letter we address a question: which periodic force ensures, via locking, the maximal coherence of a noisy self-sustained oscillator? Of course, one has to fix the amplitude of the force, so the nontrivial problem is in finding the optimal force profile. We will treat this problem in the phase approximation [1], which is valid for general oscillators, provided the noise and the forcing are small. In this approximation the dynamics of the phase reduces to a noisy Adler equation [2,7], and the maximal coherence is achieved if the diffusion constant of the phase is minimal. It should be noted that an optimal locking problem has been recently discussed for purely deterministic oscillations. There, the optimal condition was formulated as the maximal width of the Arnold's tongue (the synchronization region) or as the maximal stability of the locked state [3][4][5][6]. In our case there is an additional parameter, the noise intensity, and we will show that the optimal force profile depends on the noise amplitude. Below we will also compare the limit of small noise with purely deterministic setups.Let us consider a self-sustained oscillator with frequency ω, its phase in presence of a small Gaussian white noise obeys the Langevin equationwhere β −1 is the noise intensity. A small periodic forcing with frequency Ω leads, in the first order in the force amplitude, to the following phase dynamics [1,7]:Here s(ϕ) is the phase sensitivity function (a.k.a. phase response curve), and f (Ωt) is the phase-projected force term. Our goal will be to find such a forcing f (·) that maximizes the coherence, i.e. minimizes the diffusion constant of the phase ϕ. This optimal force will depend on the phase sensitivity function s(·) and on the noise intensity β.As the first step we introduce the slow phase φ = ϕ − Ωt and perform the standard averaging over the period 2πΩ −1 [1, 2], this yieldswhereand we introduced the "potential"Let us consider a situation, where the mean frequency of oscillations is exactly that of the forcing; this means that the slow phase φ performs a random walk without a bias. Thi...