Method: Numo::Pocketfft.rfft
- Defined in:
- lib/numo/pocketfft.rb
.rfft(a) ⇒ Numo::DComplex
Compute the 1-dimensional discrete Fourier Transform for real input.
95 96 97 98 99 100 101 |
# File 'lib/numo/pocketfft.rb', line 95 def rfft(a) raise ArgumentError, 'Expect class of input array to be Numo::NArray.' unless a.is_a?(Numo::NArray) raise ArgumentError, 'Expect input array to be non-empty.' if a.empty? raise ArgumentError, 'Expect input array to be one-dimensional.' unless a.ndim == 1 raw_fft(a, 0, inverse: false, real: true) end |