# Radially averaged surface roughness power spectrum (PSD) only on top or bottom part of a topography

Version 1.3.0.0 (3.25 KB) by
Calculates radially averaged 2D power spectrum for a certain part of surface topography
Updated 19 Dec 2016

In surface roughness or any topography analysis, power spectral density graph is a valuable characterisation tool. However, there are times when we are only interested in a specific part of a surface topography. For instance, if the surface topography is skewed at the bottom (which will affect the PSD results), we would like to carry out the PSD analysis only on the top topography. For further description of the technique refer to below article (and feel free to cite it, if you find the code useful):
Kanafi, Mona Mahboob, and Ari Juhani Tuononen. "Top Topography Surface Roughness Power Spectrum for Pavement Friction Evaluation." Tribology International (2016).

This code is a continuation of surface roughness PSD for the full surface topography, i.e. Radially Averaged Surface Roughness Power Spectrum:

The code calculates the 2D PSD of a surface topography either on the top topography or the bottom topography, at a certain depth or portion of the surface topography, given by the user. The surface topography is normally obtained by any 3D profilometry techniques, such as AFM (Atomic Force Microscopy), WLI (White Light Interferometry) and many other optical profilers.

You need to provide 5 inputs to the code. 1- You need to have a matrix (n by m) of your height values (z). 2- You need to know you PixelWidth (spatial resolution) which is obtained easily by dividing you image length to the number of pixels in length, i.e. :

PixelWidth = Lx / m; % in SI units

3- You will specify whether you want to carry out analysis on ‘top’ or then the ‘bottom’ profile. 4- You will specify whether you will provide the code with the ‘depth’ or then the ‘percent’ of data you are interested in. And finally 5- give the depth or percent value!

An example input would be:

[q , C , PSD] = top_bottom_2Dpsd(z , 6e-6 ,'top' ,'percent',20)

Above line calculates the 2D radially averaged PSD for 20% of data, but from the top topography. z denotes the matrix of height values and the second input is the pixel width of z profile, which was 6 micron.

Please note that when the percentage of data is set to 100, it means the whole surface topography is used for calculation!

In order to plot the output:
loglog(q,C)

To generate an artificial randomly rough surface/topography to try the code, refer to:

Surface generator: artificial randomly rough surfaces
http://se.mathworks.com/matlabcentral/fileexchange/60817-surface-generator--artificial-randomly-rough-surfaces

### Cite As

Mona Mahboob Kanafi (2024). Radially averaged surface roughness power spectrum (PSD) only on top or bottom part of a topography (https://www.mathworks.com/matlabcentral/fileexchange/60771-radially-averaged-surface-roughness-power-spectrum-psd-only-on-top-or-bottom-part-of-a-topography), MATLAB Central File Exchange. Retrieved .

##### MATLAB Release Compatibility
Created with R2016a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux
##### Categories
Find more on Fourier Analysis and Filtering in Help Center and MATLAB Answers

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

#### Top_Bottom_PSD/

Version Published Release Notes
1.3.0.0