We present a new technique to calculate the spectral lags of {gamma}-ray bursts (GRBs). Unlike previous processing methods, we first smooth the light curves of {gamma}-ray bursts in high- and low-energy bands using the "Loess" filter, then we directly define the spectral lags as such to maximize the cross-correlation function (CCF) between two smoothed light curves.