[英]How to mark noisy points on from a signal
以下代碼可能有效:
array=abs([0 diff(signal)])
threshold_for_noisy=15
for i=1:size(array,2)
if array(i)>threshold_for_noisy
noisy_ind(i)=1;
else
noisy_ind(i)=0;
end
end
abnormal=zeros(1,size(array,2));
ch_pt=find(noisy_ind==1)
for i=1:2:size(ch_pt,2)-1
abnormal(ch_pt(i):ch_pt(i+1))=1
end
每當您的信號超過閾值並持續到恢復正常 (threshold_for_noisy) 時,異常元素將為 1。
由於您在此處提供的數據集沒有太大的差異,因此我在代碼中建議的過去未來值的簡單比較將起作用。 但如果您的數據方差較大,您可以考慮使用 Signal Processing Toolbox 中的內置 function。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.