Error using chktransargs>getTimeVector Expected T to be strictly increasing.
古いコメントを表示
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 件のコメント
Walter Roberson
2022 年 11 月 7 日
%for debugging check
nnz(~isfinite(t)) %any nan or inf?
issorted(t) %are they out of order ?
issorted(t, 'strictascend') %if this fails but issorted worked then there are duplicates
numel(t) - numel(unique(t)) %non-zero implies non-nan duplicates
Jasmine
2022 年 11 月 7 日
Jasmine
2022 年 11 月 7 日
Walter Roberson
2022 年 11 月 7 日
Your time vector is in ascending order but it has 2699 duplicate times. risetime() only works if the times are unique.
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
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 件)
カテゴリ
ヘルプ センター および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!