\section{Conclusions}
In conclusion, we have proposed and studied theoretically a new method for generation of tunable  single-cycle THz waves via reflection of a train of few-cycle femtosecond pulses from a thin nonlinear layer of a medium which possesses resonances in THz range. The one-dimensional propagation problem was considered, which is valid in a single-mode fiber or at distances much smaller than the diffraction length. The method is based on the free induction decay and coherent control of the low-frequency oscillations arising in the medium using femtosecond pulse trains and also utilized peculiarities of nonlinear reflection in 1D case.

We have demonstrated that our method can exhibit reasonable conversion efficiency up to $\sim 10^{-3}$.
The power and waveshape of the generated THz pulse can be controlled by the excitation pulse energy and duration, as well as by the thickness of the layer. Other advantages of the proposed method are its simplicity and compactness. It can be realized in a broad class of nonlinear RAM layers with commercially available femtosecond pulse sources.  Thus, we believe that the proposed method can serve as a novel high-efficient approach to generate THz waveforms with a tunable waveshape.
 

\section*{Funding Information}
R.A. and A.P. thank Russian Science Foundation (project 19-72-00012). I.B. thanks Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), projects BA 4156/4-2 and MO 850-19/2,
as well as Germany’s Excellence Strategy within the Cluster of Excellence PhoenixD (EXC 2122, Project ID 390833453).


