Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TVec RemoveDC(TVec SrcDst) | In-place version of the RemoveDC method. |
| └ indexed: TVec RemoveDC(TVec SrcDst, Int32 Index, Int32 Len) | ||
| 2 | void RemoveDC(TVec Src, TVec Dst) | Not-In-place version of the RemoveDC method. |
| └ indexed: void RemoveDC(TVec Src, TVec Dst, Int32 SrcIndex, Int32 DstIndex, Int32 Len) |
Overload 1: TVec RemoveDC(TVec SrcDst)
In-place version of the RemoveDC method.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | SrcDst | TVec | source TVec |
Returns: TVec
Indexed: TVec RemoveDC(TVec SrcDst, Int32 Index, Int32 Len)
Remove the DC component.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | SrcDst | TVec | source TVec |
| 2 | Index | Int32 | start index |
| 3 | Len | Int32 | element count |
Returns: TVec
Subtract the mean value of Data from Data. Works for stationary signals. Use a highpass FIR filter for signals with varying mean value or call the DcFilter routine, for an IIR version of the DC filter. Removing the DC component without applying a true FIR
or IIR filter is often convinient prior to frequency analysis, because there is no run-in or run-out and no filter delay.
using Dew.Math;
using Dew.Math.Editors;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;
private void button1_Click(object sender, EventArgs e)
{
Vector b = new Vector(0);
Vector c = new Vector(0);
Vector Response1 = new Vector(0);
Vector Response2 = new Vector(0);
SignalUtils.Tone(b, 256, 6.0 / 256, 0, 1, false);
b = b + 4;
c.Copy(b);
SignalUtils.RemoveDC(b);
MtxVecTee.DrawIt(new TVec[2] {c,b}, new string[2] {"Original signal","Signal without DC"},"Time signals", false);
SignalUtils.FrequencyResponse(c, null, Response1, 1, true, TSignalWindowType.wtRectangular, 0);
SignalUtils.FrequencyResponse(b, null, Response2, 1, true, TSignalWindowType.wtRectangular, 0);
MtxVecTee.DrawIt(new TVec[2] {Response1,Response2}, new string[2] {"Spectrum: original signal","Spectrum: signal without DC"}, "Frequency spectrum", false);
Overload 2: void RemoveDC(TVec Src, TVec Dst)
Not-In-place version of the RemoveDC method.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Dst | TVec | source TVec |
Result: stored in self (calling object)
Indexed: void RemoveDC(TVec Src, TVec Dst, Int32 SrcIndex, Int32 DstIndex, Int32 Len)
Not-in-place version of the RemoveDC method with source and destination indexes.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Dst | TVec | source TVec |
| 3 | SrcIndex | Int32 | source start index |
| 4 | DstIndex | Int32 | destination start index |
| 5 | Len | Int32 | element count |
Result: stored in self (calling object)
The Src data is preserved, the destination will hold the result. If Len is not specified, the maximum possible value will be used.