How spectrographs that measure radial velocities manage to translate variations in the stars' spectrum lines into the "speed" of the star? Like ESPRESSO or CARMENES, for example. I just don't understand the process or the way these spectrographs manage to obtain the velocity of the "wobble" of the star (due to the presence of another companion such as an exoplanet) just by analyzing variations on spectral lines.
There are many ways to measure a star's motion, radial velocity (wobble) can be measured using doppler spectroscopy. The first exoplanet discovered by this method was 51 Pegasi b by Michel Mayor and Didier Queloz, who discovered the planet on December 1995. 

A drawback of this method is that it can only detect the movement of a star towards or away from the Earth. If the orbital plane of the planet is "face on" when observed from the Earth the wobble of the star will be perpendicular to an observer's line of vision, and no spectrum shift will be detected.

In most cases a distant planet's orbital plane is neither "edge-on" nor "face-on" when observed from the Earth. Most likely it is tilted at some angle to the line of sight, which is usually unknown. This means that a spectrograph would not detect the full movement of the star, but only that component of its wobble that moves it towards the Earth or away from it.

The ESPRESSO instrument uses two 90x90 mm CCD detectors, one red and one blue sensitive. The detectors view the light after it is reflected off of an echelle grating, which is optimized for use at high incidence angles and therefore in high diffraction orders. Higher diffraction orders allow for increased dispersion (spacing) of spectral features at the detector, enabling increased differentiation of these features. 



The equations are relatively simple. The observed Doppler velocity is $K=V_{\mathrm {star} }\sin(i)$, where $i$ is the inclination of the planet's orbit to the line perpendicular to the line-of-sight.

Reference:

"A Jupiter-mass companion to a solar-type star", Nature volume 378, pages 355–359 (1995), by Michel Mayor and Didier Queloz

An improvement to Mayor and Queloz's equations is offered in:

"The Rossiter-McLaughlin effect and analytic radial velocity curves for transiting extrasolar planetary systems" (Mar 25 2005), by Yasuhiro Ohta, Atsushi Taruya, and Yasushi Suto


  "7. Conclusions and discussion
  We have discussed a methodology to estimate the stellar spin angular velocity and its direction angle with respect to the planetary orbit for transiting extrasolar planetary systems
  using the RM effect previously known in eclipsing binary stars (Rossiter 1924; McLaughlin 1924; Kopal 1990). In particular we have derived analytic expressions of the radial velocity
  anomaly, $\Delta_{vs}$, which are sufficiently accurate for extrasolar planetary systems. If the stellar limb darkening is neglected, the expression is exact. We have extended the result to the case with limb darkening and obtained approximate but accurate analytic formulae. For a typical value of $\gamma = R_p / R_s \sim 0.1$, the formulae reduce to a simple form (eqs. [40], [43], [44], [45], [48], and [49]):
  
  $$\Delta v_s = \Omega s X_p \sin I_s \frac{\gamma^2 \{1-\varepsilon(1-W_2) \} }{ 1-\gamma^2-\varepsilon \{ \frac{1}{3}-\gamma^2 \} } \tag{56}$$
  
  during the complete transit phase and (the following is scrollable):
  
  $$\small { \Delta v_s = \Omega_s X_p \sin I_s \frac { (1- \varepsilon) \{ - z_0 \zeta + \gamma^2 \cos^{-1} (\zeta / \gamma) \} + \frac { \varepsilon }{ 1 + \eta_p } W_4 }{ \pi (1- \frac {1}{3} \varepsilon ) - (1 - \varepsilon) \{ \sin^{-1} z_0 - (1 - \eta_p) z_0 + \gamma^2 \cos^{-1} (\zeta  / \gamma) \} } \tag {57} }$$
  
  during the egress/ingress phases, where
  
  $$\begin{align}
W_2 &amp; = \frac { (R^2_s - X^2_p - Z^2_p)^{1/2} }{ R_s }, \tag {58} \\
W_4 &amp; = \frac {\pi}{2} \, \gamma^{3/2} (2 - \gamma)^{1/2} \, (\gamma - \zeta) \; x_c \frac {g(x_c ; \eta_p , \gamma) }{ g(1- \gamma ; - \gamma , \gamma) }, \tag {59}
\end{align}
$$
  
  where $g(x; a, b)$ is defined in equation (A17). The definition and the meaning of the variables in the above expressions are summarized in Table 1.
  
  The numerical accuracy of the above formulae was checked using a specific example of the transiting extrasolar planetary system, HD 209458, and we found that they are accurate
  within a few percent. Our analytic formulae for the radial velocity anomaly are useful in several ways. One can estimate the planetary parameters much more efficiently and easily,
  since one does not have to resort to computationally demanding numerical modeling. Furthermore, the resulting uncertainties of the fitted parameters and their correlations are easily evaluated.
  
  ...
  
  Table 1. List of notation
  Variables &emsp; &emsp;Definition&emsp; &emsp; &emsp;Meaning  
  
  Orbital Parameters
  $m_p$ &emsp; &emsp; &emsp; &emsp;Sec.2&emsp; &emsp; &emsp; &emsp; Planet mass
  $m_s$ &emsp; &emsp; &emsp; &emsp;Sec.2&emsp; &emsp; &emsp; &emsp; Stellar mass
  $a$ &emsp; &emsp; &emsp; &emsp; &emsp;Fig.1&emsp; &emsp; &emsp; &emsp;Semimajor axis
  $e$ &emsp; &emsp; &emsp; &emsp; &emsp;Fig.1&emsp; &emsp; &emsp; &emsp; Eccentricity of planetary orbit
  $\varpi$&emsp; &emsp; &emsp; &emsp; &emsp;Fig.1&emsp; &emsp; &emsp; &emsp;Negative longitude of the line of sight
  $i$ &emsp; &emsp; &emsp; &emsp;  &emsp; Fig.2 &emsp; &emsp; &emsp; &emsp;Inclination between normal direction of orbital plane and y-axis
  $r_p$&emsp; &emsp; &emsp; &emsp; &emsp;Eq.[1]&emsp; &emsp; &emsp; &emsp;Distance between star and planet (see Fig.1)
  $f$&emsp; &emsp; &emsp; &emsp; &emsp; Eq.[2] &emsp; &emsp; &emsp; &emsp;True anomaly (see Fig.1)
  $E$&emsp; &emsp; &emsp; &emsp; &emsp;Eq.[2]&emsp; &emsp; &emsp; &emsp;Eccentric anomaly
  $n$&emsp; &emsp; &emsp; &emsp; &emsp; Eq.[3]&emsp; &emsp; &emsp; &emsp;Mean motion
  $M$&emsp; &emsp; &emsp; &emsp;&emsp;Eq.[4]&emsp; &emsp; &emsp; &emsp;Mean anomaly  
  
  Internal Parameters of Star and Planet
  $Is$&emsp; &emsp; &emsp; &emsp;&emsp;Fig.2 &emsp; &emsp; &emsp; &emsp; Inclination between stellar spin axis and y-axis
  $λ$&emsp; &emsp; &emsp; &emsp; &emsp; Fig.3 &emsp; &emsp; &emsp; &emsp; Angle between $z$-axis and normal vector $\hat{n}_p$ on $(x, z)$-plane
  $Ω_s$&emsp; &emsp; &emsp; &emsp; &emsp;Eq.[12] &emsp; &emsp; &emsp; Annular velocity of star (see Fig.2)
  $R_s$&emsp; &emsp; &emsp; &emsp; &emsp;Sec.4&emsp; &emsp; &emsp;&emsp;Stellar radius
  $R_p$&emsp; &emsp; &emsp; &emsp; &emsp;Sec.4&emsp; &emsp; &emsp;&emsp;Planet radius
  $\varepsilon$&emsp; &emsp; &emsp; &emsp;&emsp;&emsp;Eq.[38] &emsp; &emsp; &emsp; Limb darkening parameter
  $V$ &emsp; &emsp; &emsp; &emsp; &emsp; Sec.6&emsp; &emsp; &emsp;&emsp;Stellar surface velocity, $R_sΩ_s$  
  
  Mathematical Notation
  $X_p$&emsp; &emsp; &emsp; &emsp; &emsp;Sec.4&emsp; &emsp; &emsp;&emsp;Position of the planet
  $γ$&emsp; &emsp; &emsp; &emsp;&emsp;&emsp;Eq.[25] &emsp; &emsp; &emsp; Ratio of planet radius to stellar radius, $Rp/Rs$
  $η_p$ &emsp; &emsp; &emsp; &emsp; &emsp;Eq.[28] &emsp; &emsp; &emsp; See Fig.6
  $x_0$ &emsp; &emsp; &emsp; &emsp; &emsp;Eq.[33] &emsp; &emsp; &emsp; See Fig.6