Calculate power density function of a topographic height map (csv file) containing periodic structures

Hello,
I'm a newbie to matlab facing the following issue: Based on topographic xyz values of a periodic surface pattern exported as a csv file, I need to calculate the power density function of it in order to point out very small differences in surface roughness of these patterns. Can anyone help me with this problem?

Answers (1)

unzip https://www.mathworks.com/matlabcentral/answers/uploaded_files/1416309/Cu-Folie_Paper_8um_AR0.30_2min_230515_8xZoom_1.csv.zip
d=dir('*.csv');
data=readmatrix(d.name);
P=abs(fftshift(fft2(data))).^2;
imagesc(P)
As I feared from the problem description, not much is visible here; we can try exanding small amplitudes to see if there is anything at all or not...
imagesc(abs(log2(P)))
Well, no idea what that might mean; wonder what the original actually looks like (what always should do first)...
imagesc(data)
mesh(data)
Hmmm....looks like some other artifact in the first column is obscuring everything else...that may also be screwing up the FFT...
mesh(data(:,2:end))
data=data(:,2:end);
P=abs(fftshift(fft2(data))).^2;
imagesc(P)
imagesc(log2(P))

2 Comments

So, now explain what it is you're trying to make of these data???
First, thank you very much for your help so far. The FFT looks pretty similar to the one obtained by the software of the laserscanning microscope itself (FFT.png). Unfortunately I cannot export the FFT, only the raw data.
What do I need: For example, I would like to compare the above surface structures, which have an almost perfect, smooth sinusoidal shape, with similar structures (same aspect ratio), which are, however, minimally rougher (Cu-Folie_Paper_8um_AR0.30_Verlgeichsstruktur_230511_8xZoom_3.csv.zip).
The idea now is to do this via the power density function. Ideally, I will then see individual peaks at different spatial frequencies, and I can use their positions to show the differences well.
I hope this discription is more understandable.

Sign in to comment.

Products

Release

R2023a

Asked:

on 21 Jun 2023

Community Treasure Hunt

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

Start Hunting!