Skip to content

autocorr

This opcode takes in an input array and computes its autocorrelation.

Syntax

kout[] autocorr kin[]

Performance

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

kin[] -- input array containing the sequence for autocorrelation.

Examples

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

Example of the autocorr opcode.
<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>

0dbfs = 1

instr 1
kin[] fillarray 1,0,1,0,1,0,1
kout[] autocorr kin
kcnt init 0
while kcnt < lenarray(kout) do
 printk2 kout[kcnt]
 kcnt += 1
od
turnoff
endin

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

See Also

Vectorial opcodes, array opcodes

Credits

Author: Victor Lazzarini
NUI Maynooth
2021

New in version 6.16