System identification is the process of identifying the coefficients of an unknown system using an adaptive filter. The general overview of the process is shown in System Identification –– Using an Adaptive Filter to Identify an Unknown System. The main components involved are:

The adaptive filter algorithm.

An unknown system or process to adapt to. In this example, the filter designed by `fir1`

is the unknown system.

Appropriate input data to exercise the adaptation process. In a generic system identification model, the desired signal *d*(*k*) and the input signal *x*(*k*) are used to exercise the adaptation process.

The objective of the adaptive filter is to minimize the error signal between the output of the adaptive filter *y*(*k*) and the output of the unknown system (or the system to be identified) *d*(*k*). Once the error signal is minimized, the adapted filter resembles the unknown system. The coefficients of both the filters match closely.

**Note**: If you are using R2016a or earlier, replace each call to the object with the equivalent `step`

syntax. For example, `obj(x)`

becomes `step(obj,x)`

.

**Unknown System**

Create a `dsp.FIRFilter`

object that represents the system to be identified. Use the `fir1`

function to design the filter coefficients. The designed filter is a 10th order lowpass digital filter with a cutoff frequency of 0.25.

filt =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [1x11 double]
InitialConditions: 0
Show all properties

Pass the signal `x`

to the FIR filter. The desired signal `d`

is the sum of the output of the unknown system (FIR filter) and an additive noise signal `n`

.

**Adaptive Filter**

With the unknown filter designed and the desired signal in place, create and apply the fast transversal filter object to identify the unknown filter.

Create a `dsp.FastTransversalFilter`

object to represent an adaptive filter. Set the length of the adaptive filter to 11 taps and a forgetting factor of 0.99.

ftf1 =
dsp.FastTransversalFilter with properties:
Method: 'Fast transversal least-squares'
Length: 11
ForgettingFactor: 0.9900
InitialPredictionErrorPower: 10
InitialCoefficients: 0
InitialConversionFactor: 1
LockCoefficients: false

Pass the primary input signal `x`

and the desired signal `d`

to the fast transversal filter. Run the adaptive filter to determine the unknown system. The output `y`

of the adaptive filter is the signal converged to the desired signal `d`

, thereby minimizing the error `e `

between the two signals.

w = *1×11*
-0.0043 0.0016 0.0308 0.1171 0.2204 0.2677 0.2210 0.1181 0.0323 0.0013 -0.0037

Plot the results. The output signal matches the desired signal very closely making the error between the two close to zero.

The coefficients of the FIR filter match very closely with the coefficients of the adapted filter, thereby confirming the convergence.