Moving window percentile computation using Conv
이전 댓글 표시
Hi
How to calculate 90th percentile of signal on a moving window set by conv. function. I have came across several posts on moving average calculations, such as here: https://www.mathworks.com/matlabcentral/answers/59561-how-can-i-calculate-a-centered-moving-average-with-window-size-7
But couldn't find any function to determine percentiles.
채택된 답변
추가 답변 (1개)
Matt J
2024년 9월 23일
0 개 추천
댓글 수: 8
Poulomi
2024년 9월 23일
Poulomi
2024년 9월 23일
Matt J
2024년 9월 23일
No, it's just
ordfilt2(signal,round(11*.9), ones(11,1))
Poulomi
2024년 9월 23일
pick the element approximate at position (90 %) of 11 sorted( elements) = 10
round(0.9*11)
t= 0:0.25:100;
y = sin(2*pi*t./max(t))+rand(size(t));
y90 = ordfilt2(y(:), round(11*.9), ones(11,1));
plot(y,'b')
hold on
plot(y90,'r.')
Poulomi
2024년 9월 23일
Bruno Luong
2024년 9월 23일
편집: Bruno Luong
2024년 9월 23일
Matt's solution picks the 10th largest elements of the neighborhood of 11 elements current index + (-5:5). This is 90.91 % (=10/11), granted not exactly 90% as requested.
If you need something different you need to explain. Not many people here can see why " Series remained constant for 4 or more data points all together, which is eroneous"
카테고리
도움말 센터 및 File Exchange에서 Correlation and Convolution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

