1D total variation denoising