MATLAB Answers

Jithin S
0

What sort of a filter/method can be applied to smoothen sharp peaks on a surface?

Asked by Jithin S
on 2 Aug 2019
Latest activity Answered by David K.
on 2 Aug 2019
This is a surface I simulated via coding. The surf plot shows sharp peaks.
ABAQUS_Surface texture_10,20,50.jpg
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.
Measured_Surface texture_10,20,50.jpg

  0 Comments

Sign in to comment.

1 Answer

Answer by David K.
on 2 Aug 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)
Check out the filter2 documentation to get a better idea on what it is doing. Hope this helps

  0 Comments

Sign in to comment.