I have the set of 10 signals looking like this:
They’re very noisy, while most of the noise are outliers. I need to be able to make them smooth in a way, which preservers the number of points in every signal.
So far, I’ve tried double-applied median filter and I obtained something close to what I want, but, unfortunately, not working for all of them well and not really looking realiably in the signal beginnings:
Is there any method useful for this case? My knowledge in this field is very limited basically only to median filtering and Savitzky-Golay, which doesn’t seem to do much.
I need very smooth lines preserving main trend (not super-precisely) and no outliers / oscillations as I intend to compare them to each other based on the trend similarity.
Data (A list of 10 lists)
Link: https://jpst.it/3VUqP
MWE
data = []
for filename in filenames:
for fork in json.load(open(PATH)):
# Smoothing
smooth_fork = median_filter(median_filter(fork, size=150), size=50)
# Normalization
data.append(list((np.array(smooth_fork) - np.min(smooth_fork)) / (np.max(smooth_fork) - np.min(smooth_fork))))
plt.figure()
for fork in data:
plt.plot(fork)
plt.show()
10