Error using chktransar​gs>getTime​Vector Expected T to be strictly increasing.

조회 수: 14 (최근 30일)
Jasmine
Jasmine 2022년 11월 7일
댓글: Walter Roberson 2022년 12월 28일
Trying to use the risetime/falltime functions and because I have negative and positive values in my time variable, I am getting this error. Please please help.
Here is my code:
load('ASRHsource.mat','t','v')
>> [R,LT,UT,LL,UL] = risetime(v,t,'StateLevels',[min(v),max(v)],'Tolerance',4,'PercentReferenceLevels',[10 90]) ; %#ok<*ASGLU>
risetime(v,t,'StateLevels',[min(v),max(v)],'Tolerance',4,'PercentReferenceLevels',[10 90])
trise = (ans*(1E9)); %#ok<*NOANS>
tr = num2str(trise);
Error using chktransargs>getTimeVector
Expected T to be strictly increasing.
Error in chktransargs (line 39)
t = getTimeVector(x, varargin{1:n-needDelay});
Error in transdurs (line 23)
[x, t, n] = chktransargs(0, sig, varargin{:});
Error in risetime (line 77)
[r,lwrCross,uprCross,lwrRef,uprRef] = transdurs(x,1,plotFlag,inpArgs{:});
  댓글 수: 6
Gayatri Suvarchala
Gayatri Suvarchala 2022년 12월 28일
Is there a better way to calculate rise time? Because there is always a likely hood of duplicate timestamps when we are recoding high resolution scope data.
Walter Roberson
Walter Roberson 2022년 12월 28일
How are you "recoding" the data?
If you start with high resolution data with unique timestamps, and resample to lower resolution, then there are ways to only get out one sample per bin -- but you need to define how you want to merge the multiple samples. For example one potential way is to fft(), which takes into account all available information, and then to ifft to lower time resolution. But that is not always what is desired. Suppose for example that you are doing 2:1 on a signal with a strong peak every second bin; if you extract at times corresponding to the peaks you get one output but at times half way between you might get a very different signal. So you might want a different approach that tries to use more of the information per bin.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by