Help language development. Donate to The Perl Foundation

Math::FFT::Libfftw3 cpan:FRITH last updated on 2019-11-30

examples/2Dtransform.p6
#!/usr/bin/env perl6

use Math::FFT::Libfftw3::C2C;
use Math::FFT::Libfftw3::Constants;

# direct transform
my Math::FFT::Libfftw3::C2C $fft .= new: data => 1..18, dims => (6, 3);
my @out = $fft.execute;
put @out;
# reverse transform
my Math::FFT::Libfftw3::C2C $fftr .= new: data => @out, dims => (6,3), direction => FFTW_BACKWARD;
my @outr = $fftr.execute;
put @outr».round(10⁻¹²);