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> "; ;