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 files dcblock.orc, dcblock.sco, and beats.wav.
Example 1. Example of the dcblock opcode.
/* dcblock.orc */
; 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
/* dcblock.orc */
/* dcblock.sco */
; Play Instrument #1 for 2 seconds.
i 1 0 2
; Play Instrument #2 for 2 seconds.
i 2 2 2
e
/* dcblock.sco */