A real-time spectral analysis is demonstrated experimentally with a frequency-shifting loop that includes an electro-optic phase modulator. When a single-frequency laser seeds the loop, pulse doublets are emitted if the integer Talbot condition is satisfied. With a polychromatic seed, frequency-to-time mapping is demonstrated, namely the temporal output of the loop maps the spectral power of the seed, with a resolution of 400 kHz. Due to the phase modulation function, the mapping is shown to be nonlinear. The results are in agreement with the theoretical predictions of [H. Yang et al., J. Opt. Soc. Am. B 37 , 3162 ( 2020 ) JOBPDE 0740-3224 10.1364/JOSAB.389801 ]. The extension to integrated systems for applications is discussed.