Description Usage Arguments Value See Also Examples
A function maybe useful to generates power spectrum from fft output.
1 |
x |
output of Mod(fft(imagefile)) |
disp |
TRUE requests to draw power spectrum |
reverse |
TRUE should be used when power spectrum of N x M, where one of them is odd number. |
a matrix of power spectrum
fft, Mod
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(camphora)
data(cryptomeria)
img1 <-camphora
img2 <- rgb2gray(cryptomeria)
par(mfrow=c(2,2))
image(rot90c(img1),col=gray(c(0:255)/255), main="Camphora", asp=1,
useRaster=TRUE, axes=FALSE)
o.fft <-Mod(fft(img1))
ps <- swap.quad(o.fft)
image(rot90c(log(ps)),col=gray(c(0:255)/255), main="power spectrum", asp=1,
useRaster=TRUE, axes=FALSE)
image(rot90c(img2),col=gray(c(0:255)/255), main="Cryptomeria", asp=1,
useRaster=TRUE, axes=FALSE)
image(rot90c(log(swap.quad(Mod(fft(img2))))),col=gray(c(0:255)/255),
main="power spectrum", asp=1, useRaster=TRUE, axes=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.