Skip to content
Permalink
0f7562752b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
17 lines (14 sloc) 575 Bytes
# FFT vs. Lomb-Scargle periodogram
require(lomb)
set.seed(1)
filename <- sample(list.files(path = "CorrectedFilteredLightcurves/",
pattern = "\\.dat"),
1)
tb <- read.table(paste("CorrectedFilteredLightcurves/", filename, sep = ""))
tb.fft <- fft(tb$V2)
tb.lsp <- lsp(x = tb$V1, times = tb$V2)
plot(tb.lsp$scanned,tb.lsp$power/max(tb.lsp$power), type="l", xlim=c(0,2),
xlab = "Frequency",
ylab = "Normalized Power")
lines((1:length(tb.fft))/(max(tb$V1)-min(tb$V1)),abs(tb.fft)/max(abs(tb.fft)),
col="blue")