1-dimensional surface roughness power spectrum of a profile or topography

Calculates 1D surface roughness power spectrum for a surface topography/or multiple line profiles
2.2K 次下载
更新时间 2016/12/19

查看许可证

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

引用格式

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. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.6.1.0

Bug fix.

1.6.0.0

Bug fix.

1.5.0.0

Bug Fix.

1.4.0.0

Description added.

1.3.0.0

Error handling.

1.2.0.0

Further description added.

1.1.0.0

A bug in fftshift fixed.

1.0.0.0