fftinv

fftinv — Complex-to-complex Inverse Fast Fourier Transform.

Description

Applies an Inverse Fast Fourier Transform to a complex-value input 1-dimensional array producing a complex-valued output. The output is another array containing the complex-valued signal, and both arrays are arranged in interleaved real-imaginary format. The output array will have the same size as the input, and the transform size will be equivalent to half of the length of the array. Non-power-of-two transforms are limited to even sizes with not too many factors.

Syntax

kout[] fftinv kin[]

Performance

kout[] -- output array containing the complex-valued output. It will be created if it does not exist.

kin[] -- input array containing the complex-valued input.

Examples

Here is an example of the fftinv opcode. It uses the file ifft.csd.

Example 459. Example of the fftinv opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
-d -o dac
</CsOptions>
<CsInstruments>
ksmps = 64

instr 1
ifftsize = 1024
kcnt init 0
kIn[] init  ifftsize
kOut[] init ifftsize

a1 oscili 0dbfs/2, 440

if kcnt >= ifftsize then
 kCmplx[] r2c kIn
 kSpec[] fft kCmplx
 kCmplx ifftinv kSpec
 kOut c2r kCmplx
 kcnt = 0 
endif

kIn[] shiftin a1
a2 shiftout kOut
kcnt += ksmps
   out a2
endin
</CsInstruments>
<CsScore>
i1 0 10
</CsScore>
</CsoundSynthesizer>

See Also

Vectorial opcodes

array opcodes

Array-based spectral opcodes

Credits

Author: Victor Lazzarini
NUI Maynooth
2014

New in version 6.04