eqfil
Prev | Orchestra Opcodes and Operators | Next

## eqfil

eqfil — Equalizer filter

## Description

The opcode eqfil is a 2nd order tunable equalisation filter based on Regalia and Mitra design ("Tunable Digital Frequency Response Equalization Filters", IEEE Trans. on Ac., Sp. and Sig Proc., 35 (1), 1987). It provides a peak/notch filter for building parametric/graphic equalisers.

The amplitude response for this filter will be flat (=1) for kgain=1. With kgain bigger than 1, there will be a peak at the centre frequency, whose width is given by the kbw parameter, but outside this band, the response will tend towards 1. Conversely, if kgain is smaller than 1, a notch will be created around the CF.

## Syntax

    asig eqfil ain, kcf, kbw, kgain[, 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

asig -- filtered output signal.

ain -- input signal.

kcf -- filter centre frequency.

kbw -- peak/notch bandwidth (Hz).

kgain -- peak/notch gain.

## Examples

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

Example 265. Example of the eqfil opcode.

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

    <CsoundSynthesizer>
    <CsOptions>
    ; 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 eqfil.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr 1

    kcf	= p4
    kfe	expseg	10, p3*0.9, 1800, p3*0.1, 175
    kenv	linen	.03, 0.05, p3, 0.05 ;low amplitude is needed to avoid clipping
    asig	buzz	kenv, kfe, sr/(2*kfe), 1
    afil	eqfil	asig, kcf, 200, 10
    	outs	afil*20, afil*20

    endin
    </CsInstruments>
    <CsScore>
    ; a sine wave.
    f 1 0 16384 10 1

    i 1 0 10 200	;filter centre freq=200
    i 1 + 10 1500	;filter centre freq=1500
    e
    </CsScore>
    </CsoundSynthesizer>

## Credits

Author: Victor Lazzarini
April 2007

New in version 5.06

Prev | Up | Next
ephasor | Home | evalstr