1-dimensional surface roughness power spectrum of a profile or topography
In surface roughness analysis, one of the powerful tools for roughness characterization is surface roughness power spectrum (PSD). If you have multiple line scans, for examples obtained by stylus profilers, or, if you have a 3D surface topography in which you are interested to calculate power spectrum in x direction and/or in y direction (e.g. to check anisotropy of your surface profile), you need to calculate surface roughness power spectrum for each line profile and then average calculated power spectrums together.
With this function you can calculate 1D PSD of a surface topography or multiple line scans stored in a matrix.
In case of 1D line profiles, store all your lines in one matrix, i.e. if you have ‘n’ measurements where each measurement consists of ‘m’ points, you must first store all your measurements in a matrix with size n*m, called here z, and just use below line to get your calculated 1D PSD for you:
[q , C] = psd_1D(z , PixelWidth , 'x') ;
Be aware that, you need to know you PixelWidth (spatial resolution) which is obtained easily by dividing you measurement length (L) to the number of pixels/points in length (n), i.e. :
PixelWidth = L / n; % in SI units
In case you have a surface topography matrix of size n*m, called here z, you can calculate 1D PSD considering profiles parallel to x axis or y axis. Just use below lines:
[qx , Cx] = psd_1D(z , PixelWidth , 'x') ; % profiles will be z(1,:), z(2,:), ... and so on.
[qy , Cy] = psd_1D(z , PixelWidth , 'y') ; % profiles will be z(:,1), z(:,2), ... and so on.
In order to plot the output:
loglog(q,C)
*** The "Warning: Negative data ignored " is normal and is due to shifting the frequency components to have symmetry with respect to zero frequency.
For 2-dimensional surface roughness power spectrum on surface topographies, refer to:
Radially Averaged Surface Roughness Power Spectrum
(PSD) http://se.mathworks.com/matlabcentral/fileexchange/54297-radially-averaged-surface-roughness-power-spectrum--psd-
Radially averaged surface roughness power spectrum (PSD) only on top or bottom part of a topography
http://se.mathworks.com/matlabcentral/fileexchange/60771-radially-averaged-surface-roughness-power-spectrum--psd--only-on-top-or-bottom-part-of-a-topography
To generate an artificial 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
Citar como
Mona Mahboob Kanafi (2024). 1-dimensional surface roughness power spectrum of a profile or topography (https://www.mathworks.com/matlabcentral/fileexchange/54315-1-dimensional-surface-roughness-power-spectrum-of-a-profile-or-topography), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Agradecimientos
Inspirado por: Radially averaged surface roughness/topography power spectrum (PSD), Radially averaged surface roughness power spectrum (PSD) only on top or bottom part of a topography, Surface generator: artificial randomly rough surfaces
Inspiración para: Radially averaged surface roughness/topography power spectrum (PSD), Surface generator: artificial randomly rough surfaces, Radially averaged surface roughness power spectrum (PSD) only on top or bottom part of a topography
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.