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 bya zfunc as described inESPS (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 inESPS(5-ESPS). The type specific header structure for FILT filesis shown below.
/* FILT Filter Coefficient File specific header */struct filt_header {
};
short max_num; /* maximum number of numerator coefficients. */ short max_den; /* maximum number of denominator coefficients. */ short func_spec; /* desired response function specification */ short nbands; /* number of frequency bands */ short npoints; /* number of points */ short g_size; /* grid size parameter */ short nbits; /* number of bits */ short type; /* type of filter */ short method; /* filter design method */ short spares[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 desiredgain function and its desired weighting function specified in two differentways.The "band" specification method indicates that the user specifies a seriesof non-overlapping frequency bands. One gain value and one weighting valueare entered for each band and the desired gain function and weighting functionare assumed constant over each band. Those functions are undefined in the transition regionsbetween the bands.
The "pointwise" specification method indicates that the user entered pointson a desired gain function and on a desired weighting function directly.No assumptions are made about the behavior of either functionbetween the points.
The following items are all in the FILT file specific header structure.
The data follows the header. The data structure in the file is shown below in C syntax.
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 intothe 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 whenthe specification method is by bands. npoints The number of points used to define the desired frequency response in a pointwisespecification. g_size This is the grid size, which influences the resolution of the filterdesign 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 forthis 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 (arbitrarilyshaped). method This variable describes the filter design method used to calculate the coefficients. Possiblevalues for this variable are defined in header.h. They are currently PZ_PLACE (arbitrarypole-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 thedesired gain and weighting functions when the specification method is by bands.The number of points in the array will be2*nbands. The points are given as a fraction of thesampling 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 specificationof the desired gain and weighting functions.The gain values and weighting values given in thegains andwts arrays are defined at these points.The number of points in the array will benpoints. The points are given as a fraction of thesampling 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 specificationmethod is by bands then the number of gain values will be equal tonbands. If the specification method is pointwise, the number of gain valueswill be equal tonpoints. wts This is a pointer to an array of weighting values. If the specificationmethod is by bands then the number of weighting values will be equal tonbands. If the specification method is pointwise, the number of weighting valueswill be equal tonpoints. spares There are FILT_SPARES spare shorts. This data structure is defined in <sps/filt.h>. A function is available to allocate memory forthis data structure, based on a particular header, and to fill in thetype 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 futuregeneralization of programs accessing the FILT file type.Thezfunc definition can be found inESPS (5-ESPS).
RECORD ELEMENT FILE STRUCTURE
The order of record elements is not the same in the file itself as it isin the structure defined above. The mapping is given by the tablebelow. This information should not be used by programs that use thedata record access functions. This information is provided for use onlywith generic ESPS programs (see stats(1-ESPS) or genplot(1-ESPS),for example).
Record Item Starting Element Number Number of Elements Tag 1 filt_func-> zeros 1 filt_func-> poles max_num+1 filt_func-> nsiz max_num+max_den+1 filt_func-> dsiz max_num+max_den+2 spares max_num+max_den+3 FDSPARES
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 |