dcblock — A DC blocking filter.
Implements the DC blocking filter
Y[i] = X[i] - X[i-1] + (igain * Y[i-1])
Based on work by Perry Cook.
Here is an example of the dcblock opcode. It uses the file dcblock.csd, and beats.wav.
Example 96. Example of the dcblock 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
; Audio out Audio in No messages
-odac -iadc -d ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o dcblock.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1 -- normal audio signal.
instr 1
asig soundin "beats.wav"
out asig
endin
; Instrument #2 -- dcblock-ed audio signal.
instr 2
asig soundin "beats.wav"
igain = 0.75
a1 dcblock asig, igain
out a1
endin
</CsInstruments>
<CsScore>
; Play Instrument #1 for 2 seconds.
i 1 0 2
; Play Instrument #2 for 2 seconds.
i 2 2 2
e
</CsScore>
</CsoundSynthesizer>