How to find PSD (Power spectral density) of spatial data I have profiled a surface, measuring the height of peaks and troughs at 0.02mm intervals. I have 1501 data points, the below listed as an example:

$$\begin{align}
x &amp;= 0\,\mu\text m  &amp; y &amp;= 20\,\mu\text m\\
x &amp;= 20\,\mu\text m &amp; y &amp;= 15\,\mu\text m\\
x &amp;= 40\,\mu\text m &amp; y &amp;= 12\,\mu\text m\\
x &amp;= 60\,\mu\text m &amp; y &amp;= 10\,\mu\text m\\
\end{align}$$

How do I generate a spatial as opposed to frequency PSD plot using Matlab? i.e. what function should I use.

Thankyou
A spectrum estimation method that works well in many cases is Welch's method. The MATLAB implementation is pretty straight forward to use, even when not knowing about the math behind it. Following Marcus' recommendations, you could try:

if norm(diff(X,2)) &lt; sqrt(eps) % is X evenly spaced ?
    Fs = 1/mean(diff(X)); % find the step size of X
    [Pyy,F] = pwelch(Y,[],[],[],Fs,'onesided','PSD'); % compute the PSD
    plot(log10(F),log10(Pyy)), xlabel('log [\mum^{-1}]'), ylabel('log[PSD[\mum^2/\mum^{-1}]]')
    axis tight, grid on
end