Skip to content

deconv

Inverse convolution of one array by another using the fast Fourier transform. The operation is Y(k) = X(k)/S(k), where X(k) is the spectrum of the signal x(n) to which the inverse convolution is applied, and S(k) is the spectrum of the inverse convolution operand s(n).

Syntax

out:i[] = deconv(in1:i[],in2:i[])
out:k[] = deconv(in1:k[],in2:k[])    
iout[] deconv iin1[], iin2[]
kout[] deconv kin1[], kin2[]    

Initialization

iout[] -- output array containing the inverse convolution (y(n)). The length of the output array is the same as that of input2.

iin1[] -- input to the inverse convolution (x(n)).

iin2[] -- inverse convolution operand (s(n)), determines the length of the output array.

Performance

kout[] -- output array containing the inverse convolution (y(n)). The length of the output array is the same as that of input2.

ikn1[] -- input to the inverse convolution (x(n)).

kin2[] -- inverse convolution operand (s(n)), determines the length of the output array.

Examples

Here is an example of the rfft opcode. It uses the file ideconv.csd.

Example of the deconv opcode.
<CsoundSynthesizer>
<CsOptions>
-odac 
</CsOptions>
<CsInstruments>
0dbfs=1

ifn ftgen 1,0,0,-1,"sweep.wav",0,0,1
ifn ftgen 2,0,0,-1,"rev.wav",0,0,1
ifn ftgen 3,0,0,"deconv",1,2

instr 1
 sig:a diskin2 "fox.wav"
 rev:a ftconv sig, 3, 64
     out rev*0.4
endin

</CsInstruments>
<CsScore>
i1 0 5
</CsScore>
</CsoundSynthesizer>

See Also

Vectorial opcodes

Array opcodes

Array-based spectral opcodes

Credits

Author: Victor Lazzarini
NUI Maynooth
2026