resonbnk — A resonator filter bank.


This opcode takes an array of filter paramerers in frequency-bandwidth pairs and constructs a bank of second-order resonators, in either parallel or serial connections.


asig resonbnk ain, kPar[], kmin, kmax, iper [, imode, iscal, iskip]


iper -- filter parameter interpolation period (in samples).

imode -- filter connection mode (0 = serial, 1 = parallel, defaults to 1).

iscal -- filter scaling mode (0 = no scaling, 1 and 2 modes as in reson, defaults to 0).

iskip -- skip initialisation if non-zero (defaults to 0).


asig -- output signal

ain -- input signal

kPar[] -- filter parameters in freq-bandwidth pairs.

kmin -- minimum filter frequency.

kmax -- maximum filter frequency.

This opcode is part of a suite of streaming linear prediction opcodes. It takes in an array of filter parameters in frequency/bandwidth pairs and creates a bank of filters. The minimum and maximum filter frequencies used in the filterbank are set by kmin and kmax, and any filters whose frequencies are outside this range are excluded from the filterbank. Filter coefficients are computed every iper samples and linearly interpolated throughout.


Here is an example of the resonbnk opcode using an audio input signal as lpc source. It uses the file resonbnk.csd.

Example 918. Example of the resonbnk opcode.

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

-odac -d

sr = 44100
ksmps = 64
nchnls = 1
0dbfs = 1

gifw ftgen 0,0,1024,20,2,1
instr 1
a1 diskin "fox.wav",1,0,1
kcfs[],krms,kerr,kcps lpcanal a1,1,512,1024,50,gifw
a2 rand 0dbfs
kpar[] apoleparams kcfs
kmin expseg 8000,p3/4,200,3*p3/4,600
a3 resonbnk a2*krms*kerr/4,kpar,kmin,16000-kmin,512,1
  out a3


i1 0 32

See also

Streaming Linear Predictive Coding (SLPC) Resynthesis