Moving window percentile computation using Conv
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Matt J
am 23 Sep. 2024
0 Stimmen
8 Kommentare
Poulomi
am 23 Sep. 2024
Poulomi
am 23 Sep. 2024
Matt J
am 23 Sep. 2024
No, it's just
ordfilt2(signal,round(11*.9), ones(11,1))
Poulomi
am 23 Sep. 2024
Bruno Luong
am 23 Sep. 2024
Bearbeitet: Bruno Luong
am 23 Sep. 2024
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
am 23 Sep. 2024
Bruno Luong
am 23 Sep. 2024
Bearbeitet: Bruno Luong
am 23 Sep. 2024
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"
Kategorien
Mehr zu Correlation and Convolution finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

