Moving window percentile computation using Conv
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Matt J
el 23 de Sept. de 2024
0 votos
8 comentarios
Poulomi
el 23 de Sept. de 2024
Poulomi
el 23 de Sept. de 2024
Matt J
el 23 de Sept. de 2024
No, it's just
ordfilt2(signal,round(11*.9), ones(11,1))
Poulomi
el 23 de Sept. de 2024
Bruno Luong
el 23 de Sept. de 2024
Editada: Bruno Luong
el 23 de Sept. de 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
el 23 de Sept. de 2024
Bruno Luong
el 23 de Sept. de 2024
Editada: Bruno Luong
el 23 de Sept. de 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"
Categorías
Más información sobre Correlation and Convolution en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

