Implementation of a second-order band-reject Butterworth filter. This opcode can also be written as butbr.
Syntax
ares=butterbr(asig,xfreq,xband[,iskip])
aresbutterbrasig,xfreq,xband[,iskip]
Initialization
iskip (optional, default=0) -- Skip initialization if present and non-zero.
Performance
These filters are Butterworth second-order IIR filters. They are slightly slower than the original filters in Csound, but they offer an almost flat passband and very good precision and stopband attenuation.
asig -- Input signal to be filtered.
xfreq -- Cutoff or center frequency for each of the filters.
xband -- Bandwidth of the bandpass and bandreject filters.
Examples
Here is an example of the butterbr opcode. It uses the file butterbr-modern.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o butterbr.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1instr1; White noise signalsig:a=rand(0.5)outs(sig,sig)endininstr2; filtered noisesig:a=rand(0.7)br:a=butterbr(sig,3000,2000);center frequency = 3000,;bandwidth = +/- (2000)/2,;so 2000-4000 outs(br,br)endin</CsInstruments><CsScore>i102i22.52e</CsScore></CsoundSynthesizer>
Here is an example of the butterbr opcode. It uses the file butterbr.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o butterbr.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1instr1; White noiseasigrand0.5outsasig,asigendininstr2; filtered noiseasigrand0.7abrbutterbrasig,3000,2000;center frequency = 3000, bandwidth = +/- (2000)/2, so 2000-4000 outsabr,abrendin</CsInstruments><CsScore>i102i22.52e</CsScore></CsoundSynthesizer>