# Filter Order Estimation (Elliptic) (G Dataflow)

Version:

Estimates the Elliptic filter order.

## filter type

The type of filter that this node estimates.

Name Description
Lowpass

Estimates a lowpass filter.

Highpass

Estimates a highpass filter.

Bandpass

Estimates a bandpass filter.

Bandstop

Estimates a bandstop filter.

Default: Lowpass

## frequency specifications

Band edge frequencies of the filter, in Hz.

### lower pass frequency

First passband edge frequency in Hz.

Default: 0.2

### lower stop frequency

First stopband edge frequency in Hz.

Default: 0.3

### higher pass frequency

Second passband edge frequency in Hz. The node ignores this input for lowpass and highpass filters.

Default: 0

### higher stop frequency

Second stopband edge frequency, in Hz. The node ignores this input for lowpass and highpass filters.

Default: 0

## ripple specifications

Ripple level in the passband and stopband of the filter.

### passband

Ripple level in the passband.

Default: 0.1

### stopband

Ripple level in the stopband.

Default: 60

### dB?

A Boolean value that specifies whether this node applies a decibel scale or a linear scale to the ripple levels.

 True The node applies a decibel scale to the ripple level. False The node applies a linear scale to the ripple level.

Default: True

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## sampling frequency

The sampling frequency in Hz.

This value must be greater than zero.

Default: 1.0 Hz, which is the normalized sampling frequency

## estimated order

Minimum order value that the filter requires to meet the specifications you set.

## low cutoff frequency

Low cutoff frequency. The cutoff frequency corresponds to the edge frequency of the passband.

## high cutoff frequency

High cutoff frequency. The cutoff frequency corresponds to the edge frequency of the passband.

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## passband ripple

Ripple level in the passband in decibels.

## stopband attenuation

Stopband attenuation in decibels.

## Algorithm for Elliptic Order Estimation

This node uses the following equations to estimate the order of an Elliptic filter:

$N=⌈\frac{K*{K}_{1}^{\prime }}{{K}_{1}*{K}^{\prime }}⌉$

K = F(k) K1 = F(k1) ${K}^{\prime }=F\left(\sqrt{1-{k}^{2}}\right)$ ${K}_{1}^{\prime }=F\left(\sqrt{1-{k}_{1}^{2}}\right)$

${k}_{1}=\frac{{\epsilon }_{p}}{{\epsilon }_{s}}$ $k=\frac{{\mathrm{\Omega }}_{p}}{{\mathrm{\Omega }}_{s}}$

${\epsilon }_{p}=\sqrt{{10}^{{A}_{p}/10}-1}$
${\epsilon }_{s}=\sqrt{{10}^{{A}_{s}/10}-1}$
where
• N is the estimated order
• F(x) is the complete elliptic integral of the first kind, which is defined as $F\left(x\right)={\int }_{0}^{\pi /2}\frac{d\vartheta }{\sqrt{1-{x}^{2}{\mathrm{sin}}^{2}\left(\vartheta \right)}}$
• Ap is the passband ripple in dB
• As is the stopband ripple in dB
• $⌈⌉$ means Round Toward +Infinity

The following table lists the equations for calculating ${\mathrm{\Omega }}_{p}$ and ${\mathrm{\Omega }}_{s}$ for different types of filters:

Filter Type Equation
Lowpass filter

${\mathrm{\Omega }}_{p}={\mathrm{\Omega }}_{p1}$

${\mathrm{\Omega }}_{s}={\mathrm{\Omega }}_{s1}$

Highpass filter

${\mathrm{\Omega }}_{p}=1/{\mathrm{\Omega }}_{p1}$

${\mathrm{\Omega }}_{s}={1/\mathrm{\Omega }}_{s1}$

Bandpass filter

$\begin{array}{c}{\mathrm{\Omega }}_{p}={\mathrm{\Omega }}_{p2}-{\mathrm{\Omega }}_{p1}\end{array}$

$\begin{array}{c}{\mathrm{\Omega }}_{s}=\mathrm{min}\left(|{\mathrm{\Omega }}_{s1}-\frac{{\mathrm{\Omega }}_{p1}{\mathrm{\Omega }}_{p2}}{{\mathrm{\Omega }}_{s1}}|,|{\mathrm{\Omega }}_{s2}-\frac{{\mathrm{\Omega }}_{p1}{\mathrm{\Omega }}_{p2}}{{\mathrm{\Omega }}_{s2}}|\right)\end{array}$

Bandstop filter

$\begin{array}{c}{\mathrm{\Omega }}_{p}=\mathrm{max}\left(|\frac{1}{{\mathrm{\Omega }}_{p1}-\frac{{\mathrm{\Omega }}_{s1}{\mathrm{\Omega }}_{s2}}{{\mathrm{\Omega }}_{p1}}}|,|\frac{1}{{\mathrm{\Omega }}_{p2}-\frac{{\mathrm{\Omega }}_{s1}{\mathrm{\Omega }}_{s2}}{{\mathrm{\Omega }}_{p2}}}|\right)\end{array}$

$\begin{array}{c}{\mathrm{\Omega }}_{s}=\frac{1}{{\mathrm{\Omega }}_{s2}-{\mathrm{\Omega }}_{s1}}\end{array}$

where the various $\mathrm{\Omega }$ values equal as follows:

${\mathrm{\Omega }}_{p1}=\mathrm{tan}\left(\pi *\frac{\mathrm{lower pass frequency}}{\mathrm{sampling frequency}}\right)$
${\mathrm{\Omega }}_{p2}=\mathrm{tan}\left(\pi *\frac{\mathrm{higher pass frequency}}{\mathrm{sampling frequency}}\right)$
${\mathrm{\Omega }}_{s1}=\mathrm{tan}\left(\pi *\frac{\mathrm{lower stop frequency}}{\mathrm{sampling frequency}}\right)$
${\mathrm{\Omega }}_{s2}=\mathrm{tan}\left(\pi *\frac{\mathrm{higher stop frequency}}{\mathrm{sampling frequency}}\right)$

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application