A method for characterizing the spectral phase of a laser pulse, comprising the following steps: - applying spectral phases to the laser pulse by applying unknown amounts of dispersion, said unknown amounts of dispersion being described by a theoretical model of functional dependence on a pulse compressor position or step, so as to scan a dispersion range between a lower limit and an upper limit of said range, continuously or in a stepwise fashion along said range; - for each of the applied spectral phases, applying a nonlinear optical process to the laser pulse, obtaining a nonlinear signal; - measuring the optical power spectrum of the nonlinear signals resulting from the preceding step, obtaining a measured d-scan trace; - calculating an iterative numerical algorithm comprising the steps of: - defining the functions of the spectral phase of the laser pulse to be characterized and the unknow applied dispersion as discrete sampling functions, consecutive derivatives with respect to frequency, Taylor expansion functions, Fourier series functions; - initially simulating a d-scan trace from a random guess phase for the functions of the spectral phase of the laser pulse and the unknown applied dispersion defined in the previous step; - for each unknown amount of applied dispersion of the dispersion scanning system, calculating the optical power spectrum of the nonlinear signal of the laser pulse from the optical power spectrum and an initial guess spectral phase of the laser pulse, obtaining a calculated d-scan trace; - calculating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion from the measured d-scan trace and the simulated d-scan trace, by iteratively approximating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion, comprising minimizing an error function defined between the measured d-scan trace and the simulated d-scan trace; - calculating the temporal amplitude and temporal phase of the laser pulse for optimum compression and for the applied dispersion range by applying an inverse Fourier transform to the optical power spectrum and the retrieved spectral phase, adjusting the compressor position or step to obtain a desired temporal pulse shape and duration. - applying spectral phases to the laser pulse by applying unknown amounts of dispersion, said unknown amounts of dispersion being described by a theoretical model of functional dependence on a pulse compressor position or step, so as to scan a dispersion range between a lower limit and an upper limit of said range, continuously or in a stepwise fashion along said range; - for each of the applied spectral phases, applying a nonlinear optical process to the laser pulse, obtaining a nonlinear signal; - measuring the optical power spectrum of the nonlinear signals resulting from the preceding step, obtaining a measured d-scan trace; - calculating an iterative numerical algorithm comprising the steps of: - defining the functions of the spectral phase of the laser pulse to be characterized and the unknow applied dispersion as discrete sampling functions, consecutive derivatives with respect to frequency, Taylor expansion functions, Fourier series functions; - initially simulating a d-scan trace from a random guess phase for the functions of the spectral phase of the laser pulse and the unknown applied dispersion defined in the previous step; - for each unknown amount of applied dispersion of the dispersion scanning system, calculating the optical power spectrum of the nonlinear signal of the laser pulse from the optical power spectrum and an initial guess spectral phase of the laser pulse, obtaining a calculated d-scan trace; - calculating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion from the measured d-scan trace and the simulated d-scan trace, by iteratively approximating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion, comprising minimizing an error function defined between the measured d-scan trace and the simulated d-scan trace; - defining the functions of the spectral phase of the laser pulse to be characterized and the unknow applied dispersion as discrete sampling functions, consecutive derivatives with respect to frequency, Taylor expansion functions, Fourier series functions; - initially simulating a d-scan trace from a random guess phase for the functions of the spectral phase of the laser pulse and the unknown applied dispersion defined in the previous step; - for each unknown amount of applied dispersion of the dispersion scanning system, calculating the optical power spectrum of the nonlinear signal of the laser pulse from the optical power spectrum and an initial guess spectral phase of the laser pulse, obtaining a calculated d-scan trace; - calculating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion from the measured d-scan trace and the simulated d-scan trace, by iteratively approximating the spectral phase of the laser pulse to be characterized and the unknown applied dispersion, comprising minimizing an error function defined between the measured d-scan trace and the simulated d-scan trace; - calculating the temporal amplitude and temporal phase of the laser pulse for optimum compression and for the applied dispersion range by applying an inverse Fourier transform to the optical power spectrum and the retrieved spectral phase, adjusting the compressor position or step to obtain a desired temporal pulse shape and duration.