Compute fft, log-log plot and quantify residuals for experimental design

2 views (last 30 days)
I'm trying to learn to use MATLAB and replicate a previous study at the same time. I need to this thing explained in the text on my images. If someone can guide me as to what to read (in maltab language) or share a code that would be great. I'm not a programmer but need to test certain statistical properties of images for an experiment on visual comfort in buildings.
'' In images of the natural world the amplitude of the spectrum decreases with increasing spatial frequency approximately as 1/f, so that on log-log coordinates the sepctrum approximates a cone in shape with a slope of -1.
For each image, the two-dimensional Fourier amplitude spectrum was computed . We used the two-dimensional Fourier transform and fitted a circular regular cone.. The amplitude spectrum could be weighted according to the contrast sensitivity function described by Mannos and Sakrison (1974), whose formula reads
S(f)~~ 2.6(0.0192 + 0.114f)^e-(0.114f)^1.1
The cone had slope of -1 on log–log coordinates and was centred on the DC component (average value of the image) of the twodimensional spectrum. We used a Hanning window and therefore excluded spatial frequencies in the first four frequencies, including DC. The cone was either a circular regular cone with slope -1or a cone-line surface that expressed the meridional anisotropy in natural images. The cone or conelike surface was fit to the amplitude spectrum, or to the weighted amplitude spectrum by keeping its shape unchanged and adjusting the gain in order to minimize the sum of the squares of the residuals using the function fminsearch in Matlab with default convergence criteria. For each image, having obtained the best fit, the sum of the squared residuals provided a measure of departure from scale invariance. (When the weighting was not applied, i.e. when the weights were uniformly 1.0 rather than s(f), this was equivalent to subtracting the cone and the grand mean and computing the power.) The sums of the squared residuals for the images were correlated with their ratings of discomfort on the Likert scale. The algorithm based on a circular regular cone was simple and yet it explained an average of17.5% of the variance in people’s judgment of discomfort from images. Nevertheless, the approach has thus far ignored two parameters that are of possible significance. First, the images to which the visual system is adapted are anisotropic. They generally have less energy in oblique orientations than in the horizontal and vertical orientations. Second, as mentioned above, the contribution of spatial frequencies to aversion is not uniform but greater for spatial frequencies to which the human visual system is most sensitive, namely around 3 cpd +/- one octave. ''
I have 40 images to run through this process. I am still confused as to what metric I'm going to be quantifying for a comparison across images. I want to be able to separate images in bins according to this metric - log-log or residuals. It may be a lot to ask but if you can please help.

Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!