Is there a best way to identify anomalous peaks in signals and remove them?
2 views (last 30 days)
Show older comments
Hi to everybody!
I need some advices regarding how to find big peaks in a signal (both positive or negative). My data are hydrograms where in the x axis there is the datetime (hourly measurements) and in the y axis there is "flowls". I looked for the outliers detection in matlab using the movmean but I didn't find any changes and replacements.
This is my code:
clear; close; clc;
load('data_prova')
t= DateTime;
[B,TF,U,L,C] = filloutliers(flowls,'previous','movmean',5)
plot(t,flowls,t,B,'o')
legend('Original Data','Filled Data')
Alternatively, is there another way to do that?
Thanks in advance
4 Comments
Mathieu NOE
on 13 Jan 2021
hello
a few thougts ,
- why not simply average the data with movmean ?
- or use movmean to create a reference line and says we remove data that are 10% (to be checked) above and below this reference line ?
Answers (1)
KALYAN ACHARJYA
on 13 Jan 2021
Edited: KALYAN ACHARJYA
on 13 Jan 2021
"identify anomalous peaks in signals and remove them?"
You can do this in many ways, it depends on you and your exact needs. But you must have to decide some threshold %, based on it pre and sucessive neighbours.
- Apply the diff, if the difference, if the different quite large as per threshold %, you can delete that indices datapoints.
- It is not sure, whether those peaks because on single outliers data point or multiple, if moltiple case, you can do movesum to get the indices ranges.
Your job to get the indices, where these anomalous peaks appears, and remove those data as follows
data([index positions])=[]
The resulting data length will be shorter than the original data point. Here you have to contact locally. Other methods are also available, please answer the same question as the related MATLAB.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!