Commit 05c6125a authored by Leon Merten Lohse's avatar Leon Merten Lohse
Browse files

rename psd.m to powerSpectralDensity.m

avoids shadowing MATLABs builtin function psd

fix #2
parent 3a6b8cc4
Pipeline #110658 passed with stage
in 1 minute and 31 seconds
function psdVals = psd(array, betaWindow) function psdVals = powerSpectralDensity(array, betaWindow)
% PSD computes the power-spectral-density (PSD) of a given array. % POWERSPECTRALDENSITY computes the power-spectral-density (PSD) of a given array.
% %
% ``psdVals = psd(array, beta_window)`` % ``psdVals = powerSpectralDensity(array, beta_window)``
% %
% Note that prior to the Fourier transform, the array is weighted with a Kaiser-Bessel window % Note that prior to the Fourier transform, the array is weighted with a Kaiser-Bessel window
% in order to avoid truncation errors. % in order to avoid truncation errors.
...@@ -30,7 +30,7 @@ function psdVals = psd(array, betaWindow) ...@@ -30,7 +30,7 @@ function psdVals = psd(array, betaWindow)
% im = fspecial('disk', r_disk); % im = fspecial('disk', r_disk);
% im = padarray(padarray(im, ceil((N-size(im))/2), 0, 'pre'), floor((N-size(im))/2), 0, 'post'); % im = padarray(padarray(im, ceil((N-size(im))/2), 0, 'pre'), floor((N-size(im))/2), 0, 'post');
% figure('name', 'image'); showImage(im) % figure('name', 'image'); showImage(im)
% figure('name', 'Log(PSD(image))'); showImage(log(psd(im))) % figure('name', 'Log(PSD(image))'); showImage(log(powerSpectralDensity(im)))
% HoloTomoToolbox % HoloTomoToolbox
% Copyright (C) 2019 Institut fuer Roentgenphysik, Universitaet Goettingen % Copyright (C) 2019 Institut fuer Roentgenphysik, Universitaet Goettingen
......
...@@ -79,7 +79,7 @@ hologram = cropToCenter(hologram, min(size(hologram))*[1,1]); ...@@ -79,7 +79,7 @@ hologram = cropToCenter(hologram, min(size(hologram))*[1,1]);
hologram = fadeoutImage(hologram); hologram = fadeoutImage(hologram);
% Compute angularly averaged, logarithmic power-spectral-density (PSD) % Compute angularly averaged, logarithmic power-spectral-density (PSD)
hologramPSDAngularAvg = angularAverage(psd(double(hologram))); hologramPSDAngularAvg = angularAverage(powerSpectralDensity(double(hologram)));
% Fourier-frequencies corresponding to the PSD-values, normalized with Fresnel number % Fourier-frequencies corresponding to the PSD-values, normalized with Fresnel number
fourierFreqs = fftfreq(size(hologram,1)); fourierFreqs = fftfreq(size(hologram,1));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment