DC Block
Overview
A DC blocker is a high-pass filter which attenuates frequencies below the signal’s lowest frequency of interest. Eliminating the DC offset from a signal allows the signal to be analyzed or processed more effectively in subsequent stages.
dc_block
is an implementation of a DC blocker based on Julius O. Smith’s document Introduction to Digital Filters.
Declaration
struct dc_block
{
dc_block(frequency f, float sps);
float operator()(float s);
float operator()() const;
dc_block& operator=(float y);
void cutoff(frequency f, float sps);
};
Expressions
Notation
bk
,a
,b
-
Objects of type
dc_block
. f
-
Object of type
frequency
representing the cutoff frequency. sps
-
Floating point value representing samples per second.
s
-
Input sample.
Constructors and Assignment
Expression | Semantics |
---|---|
|
Construct a |
|
Copy construct a |
|
Assign |
|
Set the latest result to |
C++ brace initialization may also be used. |
Expression | Semantics | Return Type |
---|---|---|
|
Return the latest result. |
|
|
Remove DC from the input sample |
|