| System Identification Toolbox | ![]() |
Filter data using general filters or Butterworth filters.
Syntax
zf = idfilt(z,filter) zf = idfilt(z,ord,Wn) zf = idfilt(z,ord,causality) [zf,mf] = idfilt(z,ord,Wn,hs)
Description
z is the data, defined as an iddata object. zf contains the filtered data as an iddata object. The filter can be defined in two ways:
filter. This in turn can be given either as any SISO idmodel or LTI model object, or as a cell array {A,B,C,D} of SISO state-space matrices or as a cell array {num,den} of numerator/denominator filter coefficients.
...,ord,Wn,hs,..., which defines a Butterworth filter of order ord. If hs is not specified and Wn contains just one element, a low pass filter with cutoff frequency Wn (measured as a fraction of the Nyquist frequency) is obtained. If hs =' high' a high pass filter with this cutoff frequency is obtained instead. If Wn = [Wnl Wnh] is a vector with two elements, a filter (of order 2*ord) with passband between Wnl and Wnh is obtained is hs is not specified. If hs = 'stop' a bandstop filter with stop band between these two frequencies is obtained instead.
The output argument mf is the filter given as an idmodel object.
With causality = 'causal' (default) causal filtering is used. With causality = 'noncausal', a noncausal, zero-phase filter is used for the filtering.
It is common practice in identification to select a frequency band where the fit between model and data is concentrated. Often this corresponds to bandpass filtering with a pass band over the interesting breakpoints in a Bode diagram. For identification where a disturbance model also is estimated, it is better to achieve the desired estimation result by using the property 'Focus' (see Algorithm Properties) than just to prefilter the data.
Algorithm
The Butterworth filter is the same as butter in the Signal Processing Toolbox. Also, the zero-phase filter is equivalent to filtfilt in that toolbox.
References
| ident | idfrd | ![]() |