What sort of a filter/method can be applied to smoothen sharp peaks on a surface?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
This is a surface I simulated via coding. The surf plot shows sharp peaks.
I have the data as a matrix Z(101,101).
However, ideally the surface should look smooth as shown in figure below. What sort of a filter can I apply?
The sharp peaks needs to be smoothen so that it can resemble the surface given below.
0 Commenti
Risposte (2)
David K.
il 2 Ago 2019
In general, if you want to smooth out peaks you want to get rid of the high frequency content, aka a low pass filter. The easiest lpf is a moving average filter. I think this should work for your implementation.
window = 9; % Increase to smooth more, decrease to smooth less
H = ones(window)./(window^2); % Create the window and divide so that it is an average and not just a sum
filteredZ = filter2(H,Z);
surf(filteredZ)
1 Commento
Katherine Zheng
il 1 Nov 2022
Hi @David K., Thanks for you method. But your code has weird padding at edge of the surface. How can I eliminate this effect?
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!