⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fea.5t

📁 speech signal process tools
💻 5T
📖 第 1 页 / 共 2 页
字号:
When available, this will occupy.\" This occupiesthe same space in memory as BYTE or CHAR butwill be.\" ispacked into single bits in the external file.Type codes SHORT and CODED stand for types of the same size,but SHORT is used for arithmetic (signed integer) data,while CODED data consists of arbitrary codes that each designateone of a set of strings defined in the header.(See.I enumsbelow)..IP enumsThis item points to the beginning of an array of pointers.Each of these pointers is NULL unless the corresponding typeis CODED, and then it indicates the possible values for each item of thecorresponding field.More specifically, the pointer, if not NULL, points to the beginning of a null-terminated arrayof strings suitable as an argument of the function.IR lin_search2 (3\-ESPSu);these strings are the possible values.Functions are available to find the code corresponding to a given stringand vice versa; see.IR fea_encode (3\-ESPSu),.IR fea_decode (3\-ESPSu)..IP startsThis points to the beginning of an array of longs.  Each element givesthe starting point of the data for the corresponding field relative tothe pointer of the correct type in the data record.(Type CODED is treated as a SHORT)..IP derivedThis points to the beginning of an array of shorts, one for each field.  A non-zero value means that the corresponding field was "derived" from another FEA file.  That is, each element in the field corresponds to some particular element in another FEA file with a different field structure(see \fIsrcfields\fP)..IP srcfieldsThis item points to the beginning of an array of character pointers.  Each of these pointers is NULL unless the corresponding field is derived (see \fIderived\fP), in which case it points the beginning of anull-terminated array of strings.  Each string has the form.nf    <fieldname> [ <element_range> ].fiwhere <fieldname> is a field name (usually not a field in the current FEA file), and where <element_range> is a list of elements in a form suitable for the function \fIgrange_switch\fP (3\-ESPS).  The total number of elements described in this way must equal the size of the corresponding field.  For example, suppose that a FEA file contains a derived field named .I svectorof size 5.  The contents of the corresponding array of strings in .I srcfields might be as follows: "raw_power[0]", "spec_param[1,3:5]".  This is interpreted to mean that the five elements of .I svectorwere derived from elements in the .I raw_powerand.I spec_paramfields of some other FEA file \- in particular, the 5 elements of .I svectorcorrespond to \fIraw_power\fP[0], \fIspec_param\fP[1],\fIspec_param\fP[3], \fIspec_param\fP[4], and \fIspec_param\fP[5](see .I set_fea_deriv(3\-ESPSu)).  .IP sparesThere are FEA_SPARES spare shorts..IP "ndouble, ndcplx, .\ .\ .\ , nbcplx"These give the total number of scalar items of each of the typesDOUBLE, DOUBLE_CPLX, .\ .\ .\ , BYTE_CPLXin a record.The total for type CODED is included in.I nshortalong with the total for SHORT,and the totals for types BIT and CHAR are included in.I nbytealong with the total for BYTE.Some of these items have the same names as items in the common part of theheader, but their values may be different.For example.I ndoublein the common part of the header includes a count of 2 doubles for everydouble_cplx item in a FEA record and so is equal to.IR ndouble "+ 2*" ndcplxin terms of these members of the FEA-specific part of the header..PPThe data follows the header.The default data format in the file is that suggested by the followingpseudo-C structure declaration..PP.nfstruct fea_data {.TSl1 l1 l1 l.    long	tag;	/\(** position tag \(**/     double	d_data[ndouble]; 	/\(** double data \(**/    float	f_data[nfloat]; 	/\(** float data \(**/    long	l_data[nlong]; 	/\(** long data \(**/    short	s_data[nshort]; 	/\(** short and coded data \(**/    char	b_data[char]; 	/\(** byte, char, and bit data \(**/.TE};.fi.PPThe variables.I ndouble, nfloat, nlong, nshort,and.I ncharhere refer to the items in the common part of the header.They cannot actually occur in a C declaration,but are used by the FEA support routines.An alternative external format is used if the item.I field_orderhas the value YES\*-see.I field_orderabove..PPIn memory, the data is held in a structure like the one below,which is defined in.I <esps/fea.h>.The variables.I ndouble, .\ .\ .\ , nbyte, .\ .\ .\ , nbcplxhere refer to the items in the FEA-specific part of the header.Again, these items do not actually occur in a C declaration;however, a function is available to allocate memory for this data structure,based on the values in a particular header.See .IR allo_fea_rec (3\-ESPSu)..PP.nfstruct fea_data {.TSl1 l1 l1 l.    long	tag;	/\(** position tag \(**/     double	d_data[ndouble]; 	/\(** double record items \(**/    float	f_data[nfloat]; 	/\(** float record items \(**/    long	l_data[nlong]; 	/\(** long record items \(**/    short	s_data[nshort]; 	/\(** short and coded record items \(**/    char	b_data[nbyte]; 	/\(** byte, char, and bit record items \(**/    double_cplx	dc_data[ndcplx];	/\(** double complex record items \(**/    float_cplx	fc_data[nfcplx];	/\(** float complex record items \(**/    long_cplx	lc_data[nlcplx];	/\(** long complex record items \(**/    short_cplx	sc_data[nscplx];	/\(** short complex record items \(**/    byte_cplx	bc_data[nbcplx];	/\(** byte complex record items \(**/.TE};.fi.PPA feature file may have a position tag in each record.  This tag refers to records in the file named in the header field\fIcommon.refer\fR.In addition thereis space for .I ndcplxpairs of doubles,.I ndoubledoubles, .I nfcplxpairs of floats,.I nfloatfloats, .I nlcplxpairs of longs,.I nlonglongs, .I nscplxpairs of shorts,.I nshortshorts,.I nbcplxpairs of bytes, and.I nbytebytes,(where these are values from the FEA-specific part of the ESPS file header)..PPSpace in.I d_datafor fields of type DOUBLE is allocated in the order of occurrence of thefields' names in.I names.Space in the other data arrays in a record is allocated similarly.However, programs generally need not and should not depend on thisinformation about record format.  Functions are available to get apointer to the beginning of the storage in a given record for the fieldwith a given name; see.IR get_fea_ptr (3\-ESPSu)..SH EXAMPLES.PPAssume declarations.PP.nf.TSl1 l1 l.    struct header	*hd;    struct fea_data	*rec;    int	siz, rnk, *dim;    double	*pd;    short	*pe;.TE.fi.PPSuppose.I hdand.I rechave properly initialized, for example by.IR new_header (3\-ESPSu)or.IR read_header (3\-ESPSu)and by.IR allo_fea_rec (3\-ESPSu).Then the statement.IPpd = (double *)get_fea_ptr(rec, "energy", hd);.PPwill assign to.I pda pointer to the first double in the storage in.I recfor the field named "energy", provided that the field exists.Now a statement like.IP*pd = 3.7.PPwill store a value into the field in.I rec.If the field has several elements, a subscripted variable like.I pd[3]can be used instead of.I *pd.If.I recalready contains data, for example as a result of calling.IR get_fea_rec (3\-ESPSu),the data can be accessed by using.I *pdor a subscripted.I pdin an expression.  The statement.IPpe = (short *)get_fea_ptr(rec, "voicing", hd);.PPwill assign to.I pea pointer to a short integer in the storage in.I recthat holds a code for a value in the field named "voicing".A statement like.IP*pe = fea_encode("voiced", "voicing", hd);.PPwill assign the code for the string "voiced" to the short integer,and the expression.IPfea_decode(*pe, "voicing", hd);.PPwill get the string value corresponding to the code that is there..SH SEE ALSO.nf\fIallo_fea_rec\fR(3\-ESPSu), \fIget_fea_rec\fR(3\-ESPSu), \fIput_fea_rec\fR(3\-ESPSu),\fIadd_fea_fld\fR(3\-ESPSu), \fIset_fea_deriv\fR(3\-ESPSu), \fIget_fea_deriv\fR(3\-ESPSu),\fIset_seg_lab\fR(3\-ESPSu), \fIget_fea_ptr\fR(3\-ESPSu), \fIfea_encode\fR(3\-ESPSu), \fIfea_decode\fR(3\-ESPSu), \fInew_header\fR(3\-ESPSu), \fIread_header\fR(3\-ESPSu), \fIwrite_header\fR(3\-ESPSu), \fIlin_search\fR(3\-ESPSu), ESPS(5\-ESPS).fi.SH FUTURE CHANGESMake BIT type available.Support for packed bit fields in memory.Define additional values for the.I typefield in the header..SH AUTHORManual page by Rodney Johnson.Incorporates suggestions by Joe Buck, Alan Parker, and John Shore.Implementation by Alan Parker.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -