How can I find mean crossing irregularity?

조회 수: 1 (최근 30일)
furkan akhan
furkan akhan 2021년 4월 18일
편집: dpb 2021년 4월 19일
I have a sound file that contains 144000 data points. Thanks to the buffer language, I was able to break this file into windows. For each of these windows, I'd like to calculate the mean crossing irregularity. If X is the random variable for the interval between two consecutive mean crossing indices, then The ratio of this variable's standard deviation to its mean value is known as mean crossing irregularity. I'm trying to figure out what this ratio is for both of these windows. Can you help me?
sound=structWheeze(2,1).SoundData;
piece = 400;
overlap = 200;
frames = buffer(sound, piece, overlap);
for k1 = 1:fix(size(frames,2)/10)
x = 1:length(sound);
zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0);
dy = zci(sound);
for k1 = 1:size(dy,1)-1
b = [[1;1] [x(dy(k1)); x(dy(k1)+1)]]\[sound(dy(k1)); sound(dy(k1)+1)];
x0(k1) = -b(1)/b(2);
end
end

답변 (1개)

dpb
dpb 2021년 4월 18일
편집: dpb 2021년 4월 19일
z=randn(1,1000); % sample dataset
zs=(detrend(z)>0); % convert to binary at mean
iz=diff(find([0 zs])); % crossings distances
mci=std(iz)/mean(iz); % desired statistic

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by