It is theoretically well known that the measurement of the second-harmonic power generated by a quasi-phasematched (QPM) grating as a function of the frequency detuning parameter yields the Fourier transform (FT) magnitude of the complex nonlinear coefficient profile along the QPM device. This measurement can be achieved by tuning either the wavelength of the fundamental laser beam or the temperature of the QPM grating. However, without the FT phase, the magnitude of the FT cannot be unambiguously inverted to uniquely recover the nonlinear coefficient profile of the QPM grating. In this work, we demonstrate that this ambiguity can be completely lifted by placing a stronger and thinner nonlinear sample against the input (or output) of the QPM device of interest and measuring the detuning curve of this composite assembly. The crux of this method is that by construction, the nonlinear profile of this assembly has a sharp peak due to the thinner sample, followed by the weaker, broader profile of the QPM grating, which essentially constitutes a minimum-phase function. As such, its FT phase can be simply and exactly calculated from its measured FT magnitude, for example by applying to the FT amplitude the logarithmic Hilbert transform or an error-reduction algorithm. The nonlinear coefficient profile of the QPM device can thus be fully recovered by processing the measured tuning curve with a fast and simple iterative error-reduction algorithm. In this paper, we demonstrate with numerical simulations that this powerful new technique can accurately recover the period, envelope, and chirp parameters of any QPM grating.