adding new scripts for completely all publication plots

This commit is contained in:
caes 2016-08-05 22:49:11 -04:00
parent 74be4ca24c
commit 9453dc0873
3 changed files with 26 additions and 1 deletions

2
analyse.sh Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash

View File

@ -11,7 +11,7 @@ set logscale x
set ylabel "Lag [days]"
#set yrange [%YMIN:%YMAX]
set yrange [-5:7]
#set yrange [-5:7]
set key outside
set key center bottom

23
scripts/tophat_fft.pl Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env perl
use feature say;
use utf8;
use PDL::FFT;
my $PI = 3.1415926539;
my $N = 64;
my ($series, $other_series);
for (my $k=0; $k<$N; $k++) {
$series->[$k] = sin(4*$k*$PI/$N) + cos(6*$k*$PI/$N);
}
my $fft = new Math::FFT($series);
my $coeff = $fft->rdft();
my $spectrum = $fft->spctrm;
my $original_data = $fft->invrdft($coeff);
for (my $k=0; $k<$N; $k++) {
$other_series->[$k] = sin(16*$k*$PI/$N) + cos(8*$k*$PI/$N);
}
my $other_fft = $fft->clone($other_series);
my $other_coeff = $other_fft->rdft();
my $correlation = $fft->correl($other_fft);