The ADV measurements are often contaminated by spikes. This code applies bivariate kernel density function to separate the data from the spike clusters. It is observed that the code can retrieve data despite 70% measurements are contaminated by spikes. The bivariate kernel density function is
generated using Botev et al. (2010)'s FFT based code. The measurements identified as spikes are removed and replaced by the linearly interpolated values. The detail algorithm is available in the following references:
1) Islam, M.R. and Zhu, D.Z. (2013), A Kernel Density Based Algorithm to Despike ADV Data, Journal of Hydraulic Engineering, ASCE, 139(7),785-793.
2) Botev, Z.I., Grotowski, J.F., and Kroese, D.P.(2010),Kernel Density Estimation Via Diffusion, Annals of Statistics, 38(5),2916-2957.