TSignalFilter Class

Source: SignalProcessing.cs · Assembly: Dew.Signal
ComponentTMtxComponentTAnalysisTSignalTSignalFilter

public class TSignalFilter : TSignal

Apply a digital filter to the input signal.

Use this component to filter a signal: select from a large range of digital filters (FIR window / Parks-McClellan, IIR Butterworth / Chebyshev / Elliptic, median, moving-average, Savitzky-Golay, integer / fractional delay, differentiator, Hilbert, wavelet) and maintain a list of predefined filters. TSignalFilterDialog is the component editor.

For a linear filter with impulse response h the output is the convolution of the input x with h: y[n] = sum_k h[k] x[n-k]. For an IIR filter realised as second-order sections the recursion is y[n] = 1/a_0(sum_(k=0)^M b_k x[n-k] - sum_(k=1)^N a_k y[n-k]).

Design vs. external taps. When ExternalTaps is False the filter
is designed from Response, the design method and the band specification in Filters; the design only runs when Filters holds at least one template (otherwise the component is an identity pass-through and Taps stays empty). When ExternalTaps is True the user-supplied Taps are used directly (FIR taps, or IIR second-order sections interleaved as B_0,A_0,B_1,A_1,...).

The unit impulse response of a designed FIR equals its taps: h[n]=Taps[n]. A moving-average filter of length L uses h[k]=1/Lh[k]=1/L (DC gain 1). Set FloatPrecision on the operand before filling; the output Data follows the input precision.

Properties

NameTypeDescription
ActiveBooleanSet active to false to suppress the propagation of the Pull request and the subsequent call to the Update method.
AutoFilterOrderBooleanIf True, the Order/FirLength of the IIR/FIR filters will be automatically estimed.
BandWidthDoubleReturn the bandwidth of the signal.
BandwidthHDoubleReturns the upper bandwidth edge of the signal.
BandwidthLDoubleReturns the lower bandwidth edge of the signal.
BetaDoubleBeta is the parameter for the Kaiser window.
BlockAssignBooleanBlock streaming of specific properties when storing only a "template".
ChannelCountInt32Get or set the number of channels multiplexed in the data property.
ComplexBooleanSet this property to true, to request computation using complex numbers.
ContinuousBooleanIf True, the component will pass on the udpate request to the connected component.
DataTVecStores the result of the processing.
DownDelayInt32The phase delay (must be less then DownSample) used by the multi-rate FIR filter.
DownSampleInt32The downsample factor used by the multi-rate FIR filter.
DtDoubleTime between two consecutive samples.
EditorActiveBooleanReturns True, if the component editor is displayed.
ExternalTapsBooleanSet this property to True, if you have defined your own filter response and have placed the taps in the Taps property.
FiltersTFilterListHolds a list of defined filters.
FirLengthInt32Defines the length of the FIR/Median filter, if the AutoFilterOrder property is false.
FirMethodTFirFilterMethodSpecifies the FIR filter design method to be used.
FloatPrecisionTMtxFloatPrecisionSet this property to request computation in 32bit/64bit precision with real/complex numbers.
FloatPrecisionLockBooleanSet this property to true to lock changes to FloatPrecision property.
FractionalDelayDoubleDefines the combined fractional delay of the input signal (integer + fraction).
FractionalDesignSpecTFractionalImpulseDefines the FIR filter properties used for fractional delay filtering.
GridDensityInt32Grid density used by the remez exchange algorithm for optimal FIR filter design.
HzResDoubleFrequency resolution obtained, if an FFT algorithm would be run on the data.
IgnoreAttBooleanSet it to True, if you want to explicitelly define the Beta parameter for the Kaiser window, when designing a FIR filter windowed with a Kaiser window.
IIRFrequencyTransformTIirFrequencyTransformSpecifies the IIR frequency transformation method to use.
IirMethodTIirFilterMethodSpecifies the IIR filter design method to be used.
InputTAnalysisConnector property to obtain a pointer to the TSignal component holding the data to be processed.
IsDoubleBooleanSet this property to false, to request computation in 32bit floating point precision, 64bit, if true.
ItemDoubleDefault property to access values of a real signal.
ItemNumberInt32Number to label the object when it is an item in the List.
LengthInt32Get or set the length of the signal in samples.
MarksTMarkListStores the time stamps and amplitude of selected samples.
MaxAmpltDoubleStores the maximum amplitude of the signal found by the MinMax method.
MaxXDoubleUse the MaxX property to store the time stamp (in seconds) of the right most sample.
MinAmpltDoubleStores the minimum amplitude of the signal found by the MinMax method.
MinXDoubleUse the MinX property to store the time stamp of the left-most sample.
NormalizedFrequencyDoubleThe value of the normalized frequency used when defining multiband filters.
OnAfterUpdateTNotifyEventThe event is triggered after the call to the Update method.
OnBeforeUpdateTNotifyEventThe event is triggered just before the call to the Update method.
OnDisplayUpdateTNotifyEventThe event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables.
OnGetInputTNotifyEventIf the Input property is not assigned, the component will call OnGetInput.
OnNotifyUpdateTNotifyEventThe event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method.
OnParameterUpdateTNotifyEventThe event is triggered when ParamUpdate method is called. The ParamUpdate method is usually called by component editors when a value was changed by the user and the editor was "Live".
OrderInt32Defines the order of the IIR filters, if AutoFilterOrder is false.
PipeStateTPipeStateReturns the state of the pipe after the last update.
PreparedBooleanReturns true, if the filter has been succesfully initialized.
ReferenceTReferenceListStores a list of components that have to be notified, when this component is destroyed.
ResponseTResponseTypeSpecifies the type of the filter, to be designed.
SamplingFrequencyDoubleDefines the sampling frequency of the signal.
SamplingTimeDoubleThe length of the signal in seconds.
ScaleFactorDoubleDefines the factor by which to multiply the input signal.
SuspendNotifyUpdateBooleanSet this property to True, to prevent calling OnNotifyUpdate from the Update Method.
TapsTVecHolds the taps for the filter.
UpDelayInt32The phase delay (must be less then UpSample) used by the multi-rate FIR filter.
UpSampleInt32The upsample factor used by the multi-rate FIR filter.
UseNormalizedFrequencyBooleanTrue, if you want to normalize the frequency of the defined bands.
UsesInputsBooleanSet it to True to indicate, that valid signals will be connected to the Input or Inputs properties.
WaveletTWaveletTypeSet the wavelet to be used for wavelete decomposition.
WaveletDecompTWaveletDecompSelects the result of wavelet decomposition.
WaveletP1Int32Defines the first wavelet parameter (if required).
WaveletP2Int32Defines the second wavelet parameter (if required.)
WindowTSignalWindowTypeSpecifies the window type to be used when designing windowed FIR filters.

Methods

NameDescription
AllowStreamingReturns the negatated value of BlockAssign.
AppendAppends Sample to the end of the signal.
AssignAssign values of all published properties from Source.
AssignTemplateAssign values of "template-like" published properties from Source.
CopyCopies signal Data and sampling frequency information.
CrestCompute the CREST parameter.
EditorClassTo be overriden in descendanr classses.
InitInitialize streaming filter with Taps.
InputsDirtyIf all Inputs[i] are dirty the function returns true.
InternalPullWhen called, the method will pass Update requests recursively to all connected objects.
InvalidateNotifies all connected components that this component has fresh data.
LoadFromStreamLoad the component from stream.
LoadTemplateFromFileLoad a template from file.
LoadTemplateFromStreamLoad a template from stream.
MarksToStringsConvert marks to strings.
MinMaxFind minimum and maximum amplitude and store the result in the MinAmplt and MaxAmplt properties.
ParamUpdateThe method can be assigned to some other component even handler, as a notification that a parameter has changed and that Self should consider a recalculation.
PeakFind the maximum deviation of the signal from its mean value.
PipeResetRecursively processes all connected components backward and calls Reset method.
PreparePrepare the defined filter for streaming.
ProcessFilter data in Src and place the result in Dst.
ProcessSample (2)Filter a single sample.
PullRequest recalculation of the entire chain of all connected components.
PullUntilEndCalls Pull until pipeEnd is returned.
ResetSame as setting Prepared to false. Reinitializes the delay lines.
SaveTemplateToFileSave template to file.
SaveTemplateToStreamSave template to stream.
SaveToStreamSave the component state to stream.
SizeAssign the size of the signal from Src.
StateSpaceIIRReturns the currently designed IIR filter in state space form.
TransferFunIIRReturns the currently designed IIR filter in zero pole form.
UpdateRequest recalculation of the data and place the result in Self.
UpdateNotifyCall this method only, if SuspendNotifyUpdate is True.
ValuesToStringsConvert values to strings.
ZeroPoleIIRReturns the currently designed IIR filter in zero pole form.

Events

NameDescription
OnAfterUpdateEventThe event is triggered after the call to the Update method.
OnBeforeUpdateEventThe event is triggered just before the call to the Update method.
OnDisplayUpdateEventThe event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables.
OnGetInputEventIf the Input property is not assigned, the component will call OnGetInput.
OnNotifyUpdateEventThe event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method.
OnParameterUpdateEventThe event is triggered when ParamUpdate method is called. The ParamUpdate method is usually called by component editors when a value was changed by the user and the editor was "Live".