.

BiQuad Filter with Lookup Coefficients

Overview

Overview

The BiQuad Filter with Lookup Coefficients block works exactly like the standard BiQuad block, but the coefficients are re-calculated each sample. The value of each coefficient is interpolated from coefficient tables stored in the format used by BiQuad filters.

BiQuad1

The configuration values for this block are as follows:

Coefficient File Name (.txt)

The filename of a text file containing the coefficients (see Matlab/Simulink Tab for format).

Ts Sample period of the filter algorithm. This is the cycle time of the BiQuad block in a Simulink simulation. This value has no effect on the BiQuad execution on the controller.
Subsample Code A code which determines the schedule for updating this block (every sample, even samples only, etc.) See Subsampling.
User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

Matlab/Simulink

Simulink Interface

BiQuad Simulink1

The BiQuad block with lookup table coefficients works exactly like the standard BiQuad block, but the coefficients are re-calculated each sample. The value of each coefficient is interpolated from coefficient tables stored in the format used by BiQuad filters.

Configuration file format:

This file contains a list of file names for loading the lookup tables. These tables are used to compute the BiQuad coefficients each sample. The first file name contains the lookup table data, type, size (all types), minimum input value and step size (FIXED type), or input vector (VECTOR type). The next N file names contain the BiQuad Coefficients used for interpolation. The number of file names for BiQuad coefficient files must match the lookup table size parameter. The format for these files is identical to the corresponding BiQuad or Lookup configuration files.

Example configuration file:

LOOKUP_BIQ0.TXT
BIQ1.TXT
BIQ2.TXT
BIQ3.TXT
BIQ4.TXT
BIQ5.TXT

The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details.

The block's update schedule is determined by the Subsample Code (See Subsampling). The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:

BiQuad Simulink2

 

 

C++ API

BIQ_LOOKUPBlock

Declaration

Public Method

BIQ_LOOKUPBlock&   BIQ_LOOKUP();
Required Header: mechaware.h

Description

The BiQuad with Lookup block implements up to 16 second-order cascaded biquad sections. Biquad coefficients are stored in a data file and loaded when the block is loaded. The firmware allows for up to 16 additional cascaded sections to be included in the data file, if desired.

Parameters

long BIQ_LOOPUP().Length

Number of sections.

std::vector<double> BIQ_LOOPUP().Coeff

The biquad and lookup coefficients.

std::vector<double> BIQ_LOOKUP().Data

The working data for the filter. These data are usually only accessed during initialization.

long
BIQ_LOOKUP().LookupType

Lookup Table Type (0 = Direct, 1 = Fixed, 2 = Vector)

long BIQ_LOOKUP().LookupTableSize

Number of points in the Lookup table (and input vector for type 2)

std::vector<double> BIQ_LOOKUP().LookupTable[ ]

Not used for Direct (type 0) lookup.

2 element vector for Fixed (type 1) lookup.
The two points are the Input Minimum and Spacing.

1xN vector for Vector (type 2) lookup.
Array of input values used for interpolation.

Methods

Block Methods

 

See Also

BiQuad

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2012 Motion Engineering