Learn R Programming

AFM (version 1.2.0)

PSD2DAgainstFrequency: Calculate the 2D Power Spectral Density

Description

PSD2DAgainstFrequency returns a data table of PSD 2D values against spatial frequencies

Usage

PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)

## S3 method for class 'AFMImage':
PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)

Arguments

AFMImage
an AFMImage to be analysed
AFMImagePSDAnalysis
an AFMImagePSDAnalysis to store PSD analysis results

Value

  • PSD2DAgainstFrequency returns a data table of frequencies and PSD values
    • freq: the considered frequency
    • PSD: the considered PSD value
    • type: PSD-2D
    • fullfilename: directory and filename on the disk

References

Sidick2009, Erkin Sidick "Power Spectral Density Specification and Analysis of Large Optical Surfaces", 2009, "Modeling Aspects in Optical Metrology II, Proc. of SPIE Vol. 7390 73900L-1"

Examples

Run this code
library(AFM)
library(ggplot2)
library(plyr)

# Calculate Power Spectrum Density in 2D against frequency
data("AFMImageOfNormallyDistributedHeights")
oneAFMImage<-AFMImageOfNormallyDistributedHeights
psd2d<-PSD2DAgainstFrequency(oneAFMImage)
p <- ggplot(data=psd2d)
p <- p + geom_point(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-2D")))
p <- p + geom_line(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-1D")),size=1.1)
p <- p + scale_x_log10()
p <- p + scale_y_log10()
p <- p + ylab("PSD (nm^4)")
p <- p + xlab("Frequency (nm^-1)")
p <- p + ggtitle(basename(oneAFMImage@fullfilename))
p

Run the code above in your browser using DataLab