We present a method to obtain a misfit function for robust waveform inversion. This method, designated as adaptive traveltime inversion (ATI), computes a matching filter that matches the measured data to the predicted one. If the velocity model is accurate, the resulting matching filter reduces to an (approximate) Dirac delta function. Its traveltime shift, which characterizes the defocusing of the matching filter, is computed by minimization of the cross-correlation between a penalty function like $t$ and the matching filter. The ATI misfit function is constructed by the minimization of the least square error of the calculated traveltime shifts. Further analysis shows that the resulting traveltime shifts correspond to the first-order moment, the mean value, of the resulting matching filter distribution. We extend ATI to a more general misfit function formula by computing different order moment of the resulting matching filter distribution. Choosing the penalty function in adaptive waveform inversion (AWI) as $t$, the misfit function of AWI can be interpreted as the second-order moment. We use the Marmousi model to verify the effectiveness of the proposed method.