fall time of square wave
이전 댓글 표시
Hi everyone... I want to know the time that my pulses goes 0 (the red points) what is the best way to do that.

답변 (2개)
Try this:
N = 200;
% fake data:
vec = ones(1,N);
vec(randperm(N,5)) = 0;
% detect zeros:
idx = diff(vec)<0;
plot(1:N,vec,'-b',find(idx),vec(idx),'r*')

You will also need to decide what happens with leading zeros: I have not taken them into account in this algorithm.
댓글 수: 2
m b
2016년 5월 2일
John BG
2016년 5월 2일
Stephen's answer finds the red dots, but when you write 'know the time that my pulses goes 0 (the red points)' do you mean you want dt1+dt2+dt3+dt4 of the initial signal?

The transitions are not vertical, check the blue arrows.
Do you want to know know much time the signal is stuck on 0?
카테고리
도움말 센터 및 File Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
