skip to primary navigationskip to content
 

filt


Manual Reference Pages  - FILT (5-ESPS)

NAME

ESPS FILT Filter Coefficient File - (.filt)

CONTENTS

Synopsis
Description
Record Element File Structure
Files
See Also
Author

SYNOPSIS

#include <sps/esps.h>
#include <sps/filt.h>

DESCRIPTION

A FILT data file consists of a header followed by one or more data records. Each record consists of a position tag followed by a zfunc as described in ESPS (5-ESPS) .

The header has the following layout as defined by <sps/header.h> The data items common to all ESPS data files are described in ESPS(5-ESPS). The type specific header structure for FILT files is shown below.


/* FILT Filter Coefficient File specific header */


struct filt_header {

 shortmax_num;/* maximum number of numerator coefficients. */
 shortmax_den;/* maximum number of denominator coefficients. */
 shortfunc_spec;/* desired response function specification */
 shortnbands;/* number of frequency bands */
 shortnpoints;/* number of points */
 shortg_size;/* grid size parameter */
 shortnbits;/* number of bits */
 shorttype;/* type of filter */
 shortmethod;/* filter design method */
 shortspares[FILT_SPARES];/* spares */
 float*bandedges;/* array of band edges */
 float*points;/* array of or points */
 float*gains;/* array of gain values */
 float*wts;/* array of weighting values */
};

The header indicates that the filter design program may have its desired gain function and its desired weighting function specified in two different ways. The "band" specification method indicates that the user specifies a series of non-overlapping frequency bands. One gain value and one weighting value are entered for each band and the desired gain function and weighting function are assumed constant over each band. Those functions are undefined in the transition regions between the bands.

The "pointwise" specification method indicates that the user entered points on a desired gain function and on a desired weighting function directly. No assumptions are made about the behavior of either function between the points.

The following items are all in the FILT file specific header structure.

max_num Maximum number of numerator coefficients in any filter function in the file.
max_den Maximum number of denominator coefficients in any filter function in the file.
func_spec This indicates whether the desired frequency response function was entered into the filter design program using the band method or the pointwise method. Currently supported values include BAND, POINT, and NONE.
nbands The number of frequency bands used to define the desired frequency response when the specification method is by bands.
npoints The number of points used to define the desired frequency response in a pointwise specification.
g_size This is the grid size, which influences the resolution of the filter design algorithm.
nbits This gives the number of bits to which the coefficients have been quantized. A value of zero indicates that no quantization has taken place.
type This is a classification of the shape of the filter response. Possible values for this variable are defined in header.h. They are currently FILT_LP (low pass), FILT_HP (high pass), FILT_BP (band pass), FILT_BS (band stop), and FILT_ARB (arbitrarily shaped).
method This variable describes the filter design method used to calculate the coefficients. Possible values for this variable are defined in header.h. They are currently PZ_PLACE (arbitrary pole-zero placement), PARKS_MC (Parks-McClellen method), and WMSE (weighted mean square error method).
bandedges This is a pointer to an array of band edges used in the specification of the desired gain and weighting functions when the specification method is by bands. The number of points in the array will be 2*nbands. The points are given as a fraction of the sampling frequency, and will therefore always range from 0.0 to 0.5.
points This is a pointer to an array of points used in the pointwise specification of the desired gain and weighting functions. The gain values and weighting values given in the gains and wts arrays are defined at these points. The number of points in the array will be npoints. The points are given as a fraction of the sampling frequency, and will therefore always range from 0.0 to 0.5.
gains This is a pointer to an array of gain values. If the specification method is by bands then the number of gain values will be equal to nbands. If the specification method is pointwise, the number of gain values will be equal to npoints.
wts This is a pointer to an array of weighting values. If the specification method is by bands then the number of weighting values will be equal to nbands. If the specification method is pointwise, the number of weighting values will be equal to npoints.
spares There are FILT_SPARES spare shorts.
The data follows the header. The data structure in the file is shown below in C syntax.

This data structure is defined in <sps/filt.h>. A function is available to allocate memory for this data structure, based on a particular header, and to fill in the type fields in the common part of the header.


struct filt_data { long tag;             /* position tag */ short spares[FDSPARES];/* spares in the filter record */ struct zfunc filt_func;/* zfunc for the coefficients */ };

Spares are include in the data record definition to allow for future generalization of programs accessing the FILT file type. The zfunc definition can be found in ESPS (5-ESPS).

RECORD ELEMENT FILE STRUCTURE

The order of record elements is not the same in the file itself as it is in the structure defined above. The mapping is given by the table below. This information should not be used by programs that use the data record access functions. This information is provided for use only with generic ESPS programs (see stats(1-ESPS) or genplot(1-ESPS), for example).

Record ItemStarting Element NumberNumber of Elements
Tag01
filt_func->zeros1
filt_func->polesmax_num+1
filt_func->nsizmax_num+max_den+1
filt_func->dsizmax_num+max_den+2
sparesmax_num+max_den+3FDSPARES

FILES

/usr/include/sps/header.h
/usr/include/sps/filt.h

SEE ALSO

allo_filt_rec(3-ESPSu), get_filt_rec(3-ESPSu), put_filt_rec(3-ESPSu), read_header(3-ESPSu), write_header(3-ESPSu), new_zfunc(3-ESPSu) ESPS(5-ESPS),

AUTHOR

Brian Sublett


SunOS 5.6 FILT (5-ESPS) 10/28/87
Generated by manServer 1.07 from /usr/local/sci/esps51/man/man5/filt.5t using man macros with tbl support.