dcblock2 — A DC blocking filter.


Implements a DC blocking filter with improved DC attenuation.


ares dcblock2 ain [, iorder] [, iskip]


iorder -- filter order, minimum 4th order, defaults to 128.

iskip -- set to 1 to skip initialization (defaults to 0).


ares -- filered audio signal

ain -- input audio signal

[Note] Note

Using a value for iorder less that ksmps will not reduce DC offset efficiently.


The result can be viewed in a graphical audio editor program like audacity. audacity is available for Linux, Windows, and the MacOS and may be downloaded from http://audacity.sourceforge.net.

Here is an example of the dcblock2 opcode. It uses the file dcblock2.csd, and beats.wav.

Example 164. Example of the dcblock2 opcode.

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

; 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 dcblock2.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2

instr 1	;add DC to "beats.wav"

asig soundin "beats.wav"
asig = asig+5000	;adds DC of 5000
     outs asig, asig

instr 2	;dcblock audio

asig soundin "beats.wav"
asig = asig+5000	;adds DC
adc  dcblock2 asig	;remove DC again
     outs adc, adc



i 1 0 2
i 2 2 2


See also



By: Victor Lazzarini

New in Csound version 5.09