1. A method for magnetic resonance spectroscopy (=MRS) or magnetic resonance imaging (=MRI), the method comprising the steps of: a) applying, using an RF excitation coil, an RF excitation pulse to an object undergoing magnetic resonance spectroscopy or magnetic resonance imaging and located within an applied magnetic field that depends on spatial position and/or time, in order to create a time-domain signal, with the time-domain signal being generated by an excited transverse nuclear magnetisation precessing about the applied magnetic field, wherein the RF excitation pulse is structured to cover a whole range of NMR frequencies of interest which are present in the object; b) recording, using the RF excitation coil or an RF receiving coil, the time-domain signal either during or during and after application of the RF excitation pulse in step a); c) calculating an encoding matrix A nα , wherein: A n ⁢ ⁢ α = ∑ m = 0 n - 1 ⁢ ⁢ P m ⁢ ⅇ ⅈΦ ⁡ ( n , m , α ) n being a running number of a time-domain signal point, α a running number of a discrete image or spectral element, P m an m-th discrete element of the RF excitation pulse in a time-domain, and Φ(n, m, α) a phase accrued by the transverse nuclear magnetisation related to the discrete image or spectral element α in a time between the discrete RF excitation pulse element P m and the time-domain signal point n under an influence of the applied magnetic field; d) inverting the encoding matrix to generate a reconstruction matrix; e) extracting a vector of time domain signal points from the time domain signal; and f) calculating a matrix product between the reconstruction matrix and the vector of time domain signal points in order to reconstruct spectral or image data and to generate a spectrum or an image therefrom.