How can I calculate Kurtosis of Sound data?

조회 수: 1 (최근 30일)
Serhat Sayim
Serhat Sayim 2021년 1월 3일
댓글: dpb 2021년 1월 3일
I have sound data of people who have asthma.I made separate plots windows thanks to the start and end indexes of wheezing and non-wheezing sounds. How can I calculate the kurtosis value of each wheeze or nonwheeze windows.
wheezing starting indexes
2239
19576
30338
46537
56438
69869
97067
107264
123725
134174
wheezing ending indexes
3239
24791
31829
49212
57662
72755
99823
108708
126971
136379

채택된 답변

Star Strider
Star Strider 2021년 1월 3일
Not certain what you want.
Try this:
startidx = [2239
19576
30338
46537
56438
69869
97067
107264
123725
134174];
endidx = [3239
24791
31829
49212
57662
72755
99823
108708
126971
136379];
framelen = endidx - startidx;
fl_mean = mean(framelen);
fl_varv = var(framelen);
fl_kurt = kurtosis(framelen);
.
  댓글 수: 9
Star Strider
Star Strider 2021년 1월 3일
As always, my pleasure!
Try this for both of them:
for k = 1:numel(startidx)
ktsis_wheeze(k) = kurtosis(signal(startidx(k):endidx(k)));
end
for k = 1:numel(startidx)-1
idxrng(k,:) = [endidx(k) startidx(k+1)]; % Information To Show Indices (Delete)
ktsis_nonwheeze(k) = kurtosis(signal(endidx(k):startidx(k+1)));
end
The first loop is the same as previously, I just re-named the variable.
See if the second loop does what you want.
(Note that ‘ktsis_nonwheeze’ it is 1 element shorter than the ‘ktsis_wheeze’ vector because I do not know how your data are organised, so I do not know whether to include any other indices.)
dpb
dpb 2021년 1월 3일
Kin=arrayfun(@(2239,3239)kurtosis(X(2239:3239)),iStart,iEnd);
That's not the code I gave you...just plug your variables in where I told you:
Kin=arrayfun(@(i1,i2)kurtosis(X(i1:i2)),iStart,iEnd);
Use whatever is your array/variable name for the data in place of "X". You plotted the data so you have the variable already, use it again.

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

추가 답변 (1개)

dpb
dpb 2021년 1월 3일
Kin=arrayfun(@(i1,i2)kurtosis(X(i1:i2)),iStart,iEnd);
where X are your data and the two indexing arrays above for the "in group" sections.
The "out group" indices can be derived from the above in group values by adjustment of point numbers by one and adding the first, last points of the X vector. The same logic/functional form will then work for those sections.
Will leave as "exercise for Student" to consider the details...
  댓글 수: 2
Serhat Sayim
Serhat Sayim 2021년 1월 3일
Let me explain clearly. For example I have a wheeze plot window between 2239 and 3239. How can I calculate the kurtosis value between these values and for this window?
dpb
dpb 2021년 1월 3일
편집: dpb 2021년 1월 3일
That's exactly the code I gave you for in-between the two indices -- you have to do a minimal amount of adjustment of those two arrays to get the start-stop for the other segments from those values.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by