autocorr
This opcode takes in an input array and computes its autocorrelation.
Syntax
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-modern.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)
cnt:k = init(0)
while cnt < lenarray(kout) do
printk2(kout[cnt])
cnt += 1
od
turnoff
endin
</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>
|
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