pvscfs — Cepstrum all-pole coefficient analysis.


This opcode takes in a pvs signal in AMP_* format, applies the cepstrum transform and computes the coefficients for a an allpole filter


kCoef[],krms,kerr  pvscfs fsig, iord[,imod]


iord -- all-pole filter order.

imod -- filter stabilisation mode (0=no stabilisation; 1= pole reflection; 2 = pole limiting; defaults to 1).


kCoef[] -- all-pole filter coefficients (iord-size array)

krms - RMS estimate of source signal.

kerr - error (or residual).

fsig -- pvs signal input in PV_AMP_* format.

This opcode is part of a suite of streaming linear prediction opcodes. It takes an fsig, applies a cepstrum transform, retaining iord coefficients, and computes the coefficient for an all-pole filter. Unlike in the linear prediction case, the resulting filter may be unstable. To resolve this, two stabilisation methods are offered: poles can be reflected inside the unit circle, or limited to it. This is somewhat computationally intensive, so there is also the option of turning it off (if the particular use case allows).


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

Example 841. Example of the pvscfs opcode.

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

; Select audio/midi flags here according to platform
-odac    ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
;-o pvscfs.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

a1   diskin "fox.wav", 1 
a2   diskin "wave.wav", 1, 0, 1         ; uses noisy wave
fenv pvsanal a1, 1024, 256, 1024, 1
kcfs[],krms,kerr pvscfs fenv, p4
a3 allpole a2*krms*kerr, kcfs
a3 dcblock a3
outs a3*8, a3*8

;           order
i1 0 2.7      3
i1 3 2.7      30
i1 6 2.7      70

See also

Streaming Linear Predictive Coding (SLPC) Resynthesis