How to read zero crossing values from script?

조회 수: 14 (최근 30일)
Syed Adeel
Syed Adeel 2020년 4월 15일
답변: Star Strider 2020년 4월 19일
I have code written for locating zero crossing of a signal but I dont get how to read those values or where ther are stored? Is ther any way I can store those values in some vector or see them in command window? The portion of script for Zero crossing is as under:
zci = @(v) find(v(:).*circshift(v(:), [1 0]) <= 0);
da3td = double(da3t);
idx = zci(da3td);
if da3td(1) * da3td(end) < 0
idx = idx(2:end);
end
for k = 1:numel(idx)
t_exact(k) = interp1(da3td(idx(k))+[-1 +1]*1E-5, time(idx(k))*1E9+[-1 +1], 0);
end
  댓글 수: 2
darova
darova 2020년 4월 16일
I usually use polyxpoly for intersection
Syed Adeel
Syed Adeel 2020년 4월 19일
ty

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

답변 (1개)

Star Strider
Star Strider 2020년 4월 19일
They are stored in the ‘t_exact’ vector.
Plot them as:
figure
plot(time, da3td, '-b')
hold on
plot(t_exact, zeros(size(t_exact)), 'xr')
hold off
grid
.

카테고리

Help CenterFile Exchange에서 MATLAB Mobile Fundamentals에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by