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

11 次查看(过去 30 天)
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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by