Accelerating the pace of engineering and science

# Documentation

## Importing Filters and Spectra

### Similarities to Other Procedures

The procedures are very similar to those explained in

### Importing Filters

When you import filters, first select the appropriate filter form from the Form list. SPTool does not currently support the import of filter objects.

For every filter you specify a variable name or a value for the filter's sampling frequency in the Sampling Frequency field. Each filter form requires different variables.

#### Transfer Function

For Transfer Function, you specify the filter by its transfer function representation:

$H\left(z\right)=\frac{B\left(z\right)}{A\left(z\right)}=\frac{b\left(1\right)+b\left(2\right){z}^{-1}+\cdots +b\left(m+1\right){z}^{-m}}{a\left(1\right)+a\left(2\right){z}^{-1}+\cdots +a\left(n+1\right){z}^{-n}}$

• The Numerator field specifies a variable name or value for the numerator coefficient vector b, which contains m+1 coefficients in descending powers of z.

• The Denominator field specifies a variable name or value for the denominator coefficient vector a, which contains n+1 coefficients in descending powers of z.

#### State Space

For State Space, you specify the filter by its state-space representation:

$\begin{array}{c}\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$

The A-Matrix, B-Matrix, C-Matrix, and D-Matrix fields specify a variable name or a value for each matrix in this system.

#### Zeros, Poles, Gain

For Zeros, Poles, Gain, you specify the filter by its zero-pole-gain representation:

$H\left(z\right)=\frac{Z\left(z\right)}{P\left(z\right)}=k\frac{\left(z-z\left(1\right)\right)\left(z-z\left(2\right)\right)\cdots \left(z-z\left(m\right)\right)}{\left(z-p\left(1\right)\right)\left(z-p\left(2\right)\right)\cdots \left(z-p\left(n\right)\right)}$

• The Zeros field specifies a variable name or value for the zeros vector z, which contains the locations of m zeros.

• The Poles field specifies a variable name or value for the zeros vector p, which contains the locations of n poles.

• The Gain field specifies a variable name or value for the gain k.

#### Second Order Sections

For 2nd Order Sections you specify the filter by its second-order section representation:

$H\left(z\right)=\prod _{k=1}^{L}{H}_{k}\left(z\right)=\prod _{k=1}^{L}\frac{{b}_{0k}+{b}_{1k}{z}^{-1}+{b}_{2k}{z}^{-2}}{1+{a}_{1k}{z}^{-1}+{a}_{2k}{z}^{-2}}$

The SOS Matrix field specifies a variable name or a value for the L-by-6 SOS matrix

$sos=\left[\begin{array}{cccccc}{b}_{01}& {b}_{11}& {b}_{21}& 1& {a}_{11}& {a}_{21}\\ {b}_{02}& {b}_{12}& {b}_{22}& 1& {a}_{12}& {a}_{22}\\ ⋮& ⋮& ⋮& ⋮& ⋮& ⋮\\ {b}_{0L}& {b}_{1L}& {b}_{2L}& 1& {a}_{1L}& {a}_{2L}\end{array}\right]$

whose rows contain the numerator and denominator coefficients bik and aik of the second-order sections of H(z).

 Note   If you import a filter that was not created in SPTool, you can only edit that filter using the Pole/Zero Editor.

### Importing Spectra

When you import a power spectral density (PSD), you specify:

• A variable name or a value for the PSD vector in the PSD field

• A variable name or a value for the frequency vector in the Freq. Vector field

The PSD values in the PSD vector correspond to the frequencies contained in the Freq. Vector vector; the two vectors must have the same length.

Was this topic helpful?