Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function RemoveDC(const SrcDst: TVec): TVec; | In-place version of the RemoveDC method. |
| └ indexed: function RemoveDC(const SrcDst: TVec; Index: Integer; Len: Integer): TVec; | ||
| 2 | procedure RemoveDC(const Src: TVec; const Dst: TVec); | Not-In-place version of the RemoveDC method. |
| └ indexed: procedure RemoveDC(const Src: TVec; const Dst: TVec; SrcIndex: Integer; DstIndex: Integer; Len: Integer); |
Overload 1: function RemoveDC(const SrcDst: TVec): TVec;
In-place version of the RemoveDC method.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | SrcDst | TVec |
Returns: TVec
Indexed: function RemoveDC(const SrcDst: TVec; Index: Integer; Len: Integer): TVec;
Remove the DC component.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | SrcDst | TVec | |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | 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.
uses MtxExpr, Math387, MtxVec, SignalUtils, MtxVecTee, MtxVecEdit;
procedure TForm1.Button1Click(Sender: TObject);
var b,c,Response1, Response2: Vector;
begin
Tone(b, 256,6/256,0,1);
b := b + 4; //generate 6 periods within 256 samples, Phase = 0, Amplt = 1
c.Copy(b);
RemoveDC(b);
DrawIt([c,b],['Original signal','Signal without DC']);
FrequencyResponse(c,nil,Response1,1,True);
FrequencyResponse(b,nil,Response2,1,True);
DrawIt([Response1, Response2],['Spectrum: original signal','Spectrum: signal without DC']);
end;
Overload 2: procedure RemoveDC(const Src: TVec; const Dst: TVec);
Not-In-place version of the RemoveDC method.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | |
| 2 | Dst | TVec |
Result: stored in self (calling object)
Indexed: procedure RemoveDC(const Src: TVec; const Dst: TVec; SrcIndex: Integer; DstIndex: Integer; Len: Integer);
Not-in-place version of the RemoveDC method with source and destination indexes.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | |
| 2 | Dst | TVec | |
| 3 | SrcIndex | Integer | source start index |
| 4 | DstIndex | Integer | destination start index |
| 5 | Len | Integer | 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.