diff --git a/analyse.sh b/analyse.sh new file mode 100644 index 0000000..20d602b --- /dev/null +++ b/analyse.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash + diff --git a/scripts/templates/timelag_compare.gp b/scripts/templates/timelag_compare.gp index 7934b0d..446b60a 100644 --- a/scripts/templates/timelag_compare.gp +++ b/scripts/templates/timelag_compare.gp @@ -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 diff --git a/scripts/tophat_fft.pl b/scripts/tophat_fft.pl new file mode 100755 index 0000000..f6b4567 --- /dev/null +++ b/scripts/tophat_fft.pl @@ -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); \ No newline at end of file