FFT.pm (PDL-2.081) | : | FFT.pm (PDL-2.082) | ||
---|---|---|---|---|

skipping to change at line 100 | skipping to change at line 100 | |||

However, unlike PDL::FFT, these modules are optional, | However, unlike PDL::FFT, these modules are optional, | |||

and so may not be installed. | and so may not be installed. | |||

=cut | =cut | |||

#line 103 "FFT.pm" | #line 103 "FFT.pm" | |||

=head1 FUNCTIONS | =head1 FUNCTIONS | |||

=cut | =cut | |||

#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

=head2 fft | =head2 fft | |||

=for sig | =for sig | |||

Signature: ([io]real(n); [io]imag(n)) | Signature: ([io]real(n); [io]imag(n)) | |||

=for ref | =for ref | |||

Complex 1-D FFT of the "real" and "imag" arrays [inplace]. A single | Complex 1-D FFT of the "real" and "imag" arrays [inplace]. A single | |||

skipping to change at line 126 | skipping to change at line 126 | |||

fft($complex); | fft($complex); | |||

=for bad | =for bad | |||

fft does not process bad values. | fft does not process bad values. | |||

It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||

=cut | =cut | |||

#line 145 "FFT.pm" | #line 145 "FFT.pm" | |||

#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

sub PDL::fft { | sub PDL::fft { | |||

# Convert the first argument to decimal and check for trouble. | # Convert the first argument to decimal and check for trouble. | |||

my ($re, $im) = @_; | my ($re, $im) = @_; | |||

if (!$re->type->real) { | if (!$re->type->real) { | |||

$im=$re->im; | $im=$re->im; | |||

$re=$re->re; | $re=$re->re; | |||

} | } | |||

eval { todecimal($re); }; | eval { todecimal($re); }; | |||

if ($@) { | if ($@) { | |||

skipping to change at line 158 | skipping to change at line 158 | |||

} | } | |||

PDL::_fft_int($re,$im); | PDL::_fft_int($re,$im); | |||

if (!$_[0]->type->real) { | if (!$_[0]->type->real) { | |||

$_[0]= czip($re, $im); | $_[0]= czip($re, $im); | |||

} else { | } else { | |||

$_[0]=$re,$_[1]=$im; | $_[0]=$re,$_[1]=$im; | |||

} | } | |||

} | } | |||

#line 179 "FFT.pm" | #line 179 "FFT.pm" | |||

#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

*fft = \&PDL::fft; | *fft = \&PDL::fft; | |||

#line 186 "FFT.pm" | #line 186 "FFT.pm" | |||

#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

=head2 ifft | =head2 ifft | |||

=for sig | =for sig | |||

Signature: ([io]real(n); [io]imag(n)) | Signature: ([io]real(n); [io]imag(n)) | |||

=for ref | =for ref | |||

Complex inverse 1-D FFT of the "real" and "imag" arrays [inplace]. A single | Complex inverse 1-D FFT of the "real" and "imag" arrays [inplace]. A single | |||

skipping to change at line 189 | skipping to change at line 189 | |||

ifft($complex); | ifft($complex); | |||

=for bad | =for bad | |||

ifft does not process bad values. | ifft does not process bad values. | |||

It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||

=cut | =cut | |||

#line 218 "FFT.pm" | #line 218 "FFT.pm" | |||

#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

sub PDL::ifft { | sub PDL::ifft { | |||

# Convert the first argument to decimal and check for trouble. | # Convert the first argument to decimal and check for trouble. | |||

my ($re, $im) = @_; | my ($re, $im) = @_; | |||

if (!$re->type->real) { | if (!$re->type->real) { | |||

$im=$re->im; | $im=$re->im; | |||

$re=$re->re; | $re=$re->re; | |||

} | } | |||

eval { todecimal($re); }; | eval { todecimal($re); }; | |||

if ($@) { | if ($@) { | |||

skipping to change at line 221 | skipping to change at line 221 | |||

} | } | |||

PDL::_ifft_int($re,$im); | PDL::_ifft_int($re,$im); | |||

if (!$_[0]->type->real) { | if (!$_[0]->type->real) { | |||

$_[0]= czip($re, $im); | $_[0]= czip($re, $im); | |||

} else { | } else { | |||

$_[0]=$re,$_[1]=$im; | $_[0]=$re,$_[1]=$im; | |||

} | } | |||

} | } | |||

#line 252 "FFT.pm" | #line 252 "FFT.pm" | |||

#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||

*ifft = \&PDL::ifft; | *ifft = \&PDL::ifft; | |||

#line 259 "FFT.pm" | #line 259 "FFT.pm" | |||

#line 185 "fft.pd" | #line 185 "fft.pd" | |||

use Carp; | use Carp; | |||

use PDL::Core qw/:Func/; | use PDL::Core qw/:Func/; | |||

use PDL::Basic qw/:Func/; | use PDL::Basic qw/:Func/; | |||

use PDL::Types; | use PDL::Types; | |||

End of changes. 6 change blocks. | ||||

6 lines changed or deleted | | 6 lines changed or added |