spf
Prev | Orchestra Opcodes and Operators | Next

## spf

spf — Steiner-Parker filter.

## Description

Spf is an digital implementation of a linear Steiner-Parker analogue filter, which is a second-order multimode filter with three separate inputs for lowpass, highpass, and bandpass and one output.

## Syntax

    asig spf alp,ahp,abp, xcf, xR[, istor]

## Initialization

istor --initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.

## Performance

alp, ahp, abp -- lowpass, highpass and bandpass input signals. Different signals can be used as inputs; if the same signal is placed at the lowpass and highpass inputs, the result is a band-reject output for that signal. If the same signal is used for all inputs, an allpass filter results.

xcf -- filter cutoff frequency (a- or k-rate)

xR -- filter damping factor, which controls peaking (for bandpass, R = 1/Q, where Q is the ratio of centre frequency and bandwidth). A value of sqrt(2) (approx 1.414) gives no peaking (Butterworth response), and lower values will make the filter peak and ring. A value of 0 turns the filter into a sinusoidal oscillator. Valid values in the range of 0 - 2. At 2, the filter has real poles and so it is equivalent to two first-order filters in series.

## Examples

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

Example 998. Example of the spf opcode.

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

    <CsoundSynthesizer>
    <CsOptions>
    -odac -d
    </CsOptions>
    <CsInstruments>

    0dbfs = 1

    // three different inputs
    instr 1
     alp = diskin:a("fox.wav",1,0,1)/3
     ahp rand p4/3
     abp vco2 p4,100
     af expon 100,p3,10000
     a3 spf alp,ahp,abp,af,0.707
     out a3
     a1 = 0
    endin

    // band-reject
    instr 2
     a0 init 0
     anoi rand p4
     af expon 100,p3,10000
     as spf anoi,anoi,a0,af,0.3
     out as
    endin

    // self-oscillation
    instr 3
     a0 init 0
     anoi rand p4
     af expon 100,p3,10000
     as spf anoi,a0,a0,af,0
     out as
    endin

    </CsInstruments>
    <CsScore>
    i1 0 10 0.2
    i2 10 10 0.5
    i3 20 10 0.004
    </CsScore>
    </CsoundSynthesizer>

## Credits

Author: Victor Lazzarini
Feb 2021

Prev | Up | Next
spdist | Home | splitrig