in reply to Re^4: Quick script to check data logger data
in thread Quick script to check data logger data
Even if you prefer other methods of calculation, I hope you agree that the quick visualisations available with P:G:S are a game-changer. (The last line is just so the plot window doesn't get immediately closed because your program terminated - that's not a problem if you use a REPL like perldl)use strict; use warnings; use Math::FFT; use PDL; use PDL::Graphics::Simple; my $filePath = $ARGV[0] // "testData.txt"; my @data = do { open my $fh, $filePath or die "Can't open $filePath: $ +!"; local $/; split /\s+/, <$fh> }; my $fft = Math::FFT->new(\@data); my $spectrum = $fft->spctrm; shift @$spectrum; # Remove DC signal component line pdl($spectrum); print "ret> "; <STDIN>;
|
|---|