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 (DC gain 1). Set FloatPrecision on the operand before filling; the output Data follows the input precision.
Properties
| Name | Type | Description |
|---|---|---|
| Active | Boolean | Set active to false to suppress the propagation of the Pull request and the subsequent call to the Update method. |
| AutoFilterOrder | Boolean | If True, the Order/FirLength of the IIR/FIR filters will be automatically estimed. |
| BandWidth | Double | Return the bandwidth of the signal. |
| BandwidthH | Double | Returns the upper bandwidth edge of the signal. |
| BandwidthL | Double | Returns the lower bandwidth edge of the signal. |
| Beta | Double | Beta is the parameter for the Kaiser window. |
| BlockAssign | Boolean | Block streaming of specific properties when storing only a "template". |
| ChannelCount | Int32 | Get or set the number of channels multiplexed in the data property. |
| Complex | Boolean | Set this property to true, to request computation using complex numbers. |
| Continuous | Boolean | If True, the component will pass on the udpate request to the connected component. |
| Data | TVec | Stores the result of the processing. |
| DownDelay | Int32 | The phase delay (must be less then DownSample) used by the multi-rate FIR filter. |
| DownSample | Int32 | The downsample factor used by the multi-rate FIR filter. |
| Dt | Double | Time between two consecutive samples. |
| EditorActive | Boolean | Returns True, if the component editor is displayed. |
| ExternalTaps | Boolean | Set this property to True, if you have defined your own filter response and have placed the taps in the Taps property. |
| Filters | TFilterList | Holds a list of defined filters. |
| FirLength | Int32 | Defines the length of the FIR/Median filter, if the AutoFilterOrder property is false. |
| FirMethod | TFirFilterMethod | Specifies the FIR filter design method to be used. |
| FloatPrecision | TMtxFloatPrecision | Set this property to request computation in 32bit/64bit precision with real/complex numbers. |
| FloatPrecisionLock | Boolean | Set this property to true to lock changes to FloatPrecision property. |
| FractionalDelay | Double | Defines the combined fractional delay of the input signal (integer + fraction). |
| FractionalDesignSpec | TFractionalImpulse | Defines the FIR filter properties used for fractional delay filtering. |
| GridDensity | Int32 | Grid density used by the remez exchange algorithm for optimal FIR filter design. |
| HzRes | Double | Frequency resolution obtained, if an FFT algorithm would be run on the data. |
| IgnoreAtt | Boolean | Set 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. |
| IIRFrequencyTransform | TIirFrequencyTransform | Specifies the IIR frequency transformation method to use. |
| IirMethod | TIirFilterMethod | Specifies the IIR filter design method to be used. |
| Input | TAnalysis | Connector property to obtain a pointer to the TSignal component holding the data to be processed. |
| IsDouble | Boolean | Set this property to false, to request computation in 32bit floating point precision, 64bit, if true. |
| Item | Double | Default property to access values of a real signal. |
| ItemNumber | Int32 | Number to label the object when it is an item in the List. |
| Length | Int32 | Get or set the length of the signal in samples. |
| Marks | TMarkList | Stores the time stamps and amplitude of selected samples. |
| MaxAmplt | Double | Stores the maximum amplitude of the signal found by the MinMax method. |
| MaxX | Double | Use the MaxX property to store the time stamp (in seconds) of the right most sample. |
| MinAmplt | Double | Stores the minimum amplitude of the signal found by the MinMax method. |
| MinX | Double | Use the MinX property to store the time stamp of the left-most sample. |
| NormalizedFrequency | Double | The value of the normalized frequency used when defining multiband filters. |
| OnAfterUpdate | TNotifyEvent | The event is triggered after the call to the Update method. |
| OnBeforeUpdate | TNotifyEvent | The event is triggered just before the call to the Update method. |
| OnDisplayUpdate | TNotifyEvent | The event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables. |
| OnGetInput | TNotifyEvent | If the Input property is not assigned, the component will call OnGetInput. |
| OnNotifyUpdate | TNotifyEvent | The event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method. |
| OnParameterUpdate | TNotifyEvent | The 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". |
| Order | Int32 | Defines the order of the IIR filters, if AutoFilterOrder is false. |
| PipeState | TPipeState | Returns the state of the pipe after the last update. |
| Prepared | Boolean | Returns true, if the filter has been succesfully initialized. |
| Reference | TReferenceList | Stores a list of components that have to be notified, when this component is destroyed. |
| Response | TResponseType | Specifies the type of the filter, to be designed. |
| SamplingFrequency | Double | Defines the sampling frequency of the signal. |
| SamplingTime | Double | The length of the signal in seconds. |
| ScaleFactor | Double | Defines the factor by which to multiply the input signal. |
| SuspendNotifyUpdate | Boolean | Set this property to True, to prevent calling OnNotifyUpdate from the Update Method. |
| Taps | TVec | Holds the taps for the filter. |
| UpDelay | Int32 | The phase delay (must be less then UpSample) used by the multi-rate FIR filter. |
| UpSample | Int32 | The upsample factor used by the multi-rate FIR filter. |
| UseNormalizedFrequency | Boolean | True, if you want to normalize the frequency of the defined bands. |
| UsesInputs | Boolean | Set it to True to indicate, that valid signals will be connected to the Input or Inputs properties. |
| Wavelet | TWaveletType | Set the wavelet to be used for wavelete decomposition. |
| WaveletDecomp | TWaveletDecomp | Selects the result of wavelet decomposition. |
| WaveletP1 | Int32 | Defines the first wavelet parameter (if required). |
| WaveletP2 | Int32 | Defines the second wavelet parameter (if required.) |
| Window | TSignalWindowType | Specifies the window type to be used when designing windowed FIR filters. |
Methods
| Name | Description |
|---|---|
| AllowStreaming | Returns the negatated value of BlockAssign. |
| Append | Appends Sample to the end of the signal. |
| Assign | Assign values of all published properties from Source. |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| Copy | Copies signal Data and sampling frequency information. |
| Crest | Compute the CREST parameter. |
| EditorClass | To be overriden in descendanr classses. |
| Init | Initialize streaming filter with Taps. |
| InputsDirty | If all Inputs[i] are dirty the function returns true. |
| InternalPull | When called, the method will pass Update requests recursively to all connected objects. |
| Invalidate | Notifies all connected components that this component has fresh data. |
| LoadFromStream | Load the component from stream. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| MarksToStrings | Convert marks to strings. |
| MinMax | Find minimum and maximum amplitude and store the result in the MinAmplt and MaxAmplt properties. |
| ParamUpdate | The 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. |
| Peak | Find the maximum deviation of the signal from its mean value. |
| PipeReset | Recursively processes all connected components backward and calls Reset method. |
| Prepare | Prepare the defined filter for streaming. |
| Process | Filter data in Src and place the result in Dst. |
| ProcessSample (2) | Filter a single sample. |
| Pull | Request recalculation of the entire chain of all connected components. |
| PullUntilEnd | Calls Pull until pipeEnd is returned. |
| Reset | Same as setting Prepared to false. Reinitializes the delay lines. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component state to stream. |
| Size | Assign the size of the signal from Src. |
| StateSpaceIIR | Returns the currently designed IIR filter in state space form. |
| TransferFunIIR | Returns the currently designed IIR filter in zero pole form. |
| Update | Request recalculation of the data and place the result in Self. |
| UpdateNotify | Call this method only, if SuspendNotifyUpdate is True. |
| ValuesToStrings | Convert values to strings. |
| ZeroPoleIIR | Returns the currently designed IIR filter in zero pole form. |
Events
| Name | Description |
|---|---|
| OnAfterUpdateEvent | The event is triggered after the call to the Update method. |
| OnBeforeUpdateEvent | The event is triggered just before the call to the Update method. |
| OnDisplayUpdateEvent | The event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables. |
| OnGetInputEvent | If the Input property is not assigned, the component will call OnGetInput. |
| OnNotifyUpdateEvent | The event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method. |
| OnParameterUpdateEvent | The 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". |