필터 지우기
필터 지우기

Decimate signal that contains NANs

조회 수: 5 (최근 30일)
Sina Salehi
Sina Salehi 2019년 12월 28일
편집: Sina Salehi 2020년 1월 10일
Hi
How could I decimate signal that contains NAN values?

답변 (3개)

Ajay Pattassery
Ajay Pattassery 2019년 12월 31일
I understand you want to decimate signals that contain NaN.
I assume you would like to decimate a signal by a factor r if it contains NaN values.
I have removed the NaN values from the signal and then decimate it as follows.
x is assumed as the signal.
positionNaN = isnan(x);
x(positionNaN) = [];
y = decimate(x,r) ;
Here positionNaN is a logical array of the same size as x containing 1 whenever a NaN value is present otherwise zero.

Sina Salehi
Sina Salehi 2020년 1월 1일
Hi Ajay
My signal is time seriese and I need to keep the position of each values including NANs. So I can not easily removing NANs.
Thanks,
  댓글 수: 1
Ajay Pattassery
Ajay Pattassery 2020년 1월 2일
You could make the signal zero whenever NaN appears. There by keeping the position.
x(positionNaN) = 0;

댓글을 달려면 로그인하십시오.


Sina Salehi
Sina Salehi 2020년 1월 10일
편집: Sina Salehi 2020년 1월 10일
Can't replace NAN data with any arbitary values. They have to be NAN after decimate either.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by