feastat.3
来自「speech signal process tools」· 3 代码 · 共 169 行
3
169 行
.\" Copyright (c) 1987, 1988 Entropic Speech, Inc. All rights reserved..\" @(#)feastat.3 1.6 06 May 1997 ESI.TH FEASTAT 3\-ESPSu 06 May 1997.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Speech, Inc..SH NAME.nfallo_feastat_rec \- allocate memory for FEA_STAT file recordget_feastat_rec \- get the next data record from an ESPS FEA_STAT data fileinit_feastat_hd \- initialize an FEA file header for subtype FEA_STATput_feastat_rec \- write the next data record of an ESPS FEA_STAT file.SH SYNOPSIS.ft B.nf#include <esps/esps.h>#include <esps/fea.h>#include <esps/feastat.h>struct feastat *allo_feastat_rec(hd)struct header *hdintget_feastat_rec(data, hd, file)struct feastat *data;struct header *hd;FILE *file;intinit_feastat_hd (hd, statfield, statsize, class_type, covar, invcovar, eigen)struct header *hd;char *statfield;int statsize;char **class_type;short covar, invcovar, eigen; voidput_feastat_rec(data, hd, file)struct feastat *data;struct header *hd;FILE *file;.sp .5.fi.ft.SH DESCRIPTION.I allo_feastat_recallocates memory for a FEA_STAT file record and returns a pointer to it.Since the size of the allocated record depends on values in the datafile header, it is important to be sure that a given FEA_STAT record isconsistent with the header of the file it is being used with. (See.I init_feastat_hd) Internally, .I allo_feastat_reccalls .I allo_fea_rec(3\-ESPSu) and then hooks the FEA record up to a feastat struct. .PP.I get_feastat_recreads the next FEA_STAT record from stream \fIfile\fR into the data structurepointed to by \fIdata\fR, which must have been allocated by means of a call to .I allo_feastat_rec.The parameter .I hdpoints to the ESPS header in which the various FEA_STAT fields have beendefined.An EOF is returned upon end of file.A positive non-zero value is returned otherwise. .PP.I init_feastat_hdtakes a pointer .I hdto an ESPS FEA header. It sets.I hd.hd.fea\->fea_typeto FEA_STAT and initializes the record-field definitions to define thefields that make up a file of subtype FEA_STAT. It does thisby means of calls to.I add_fea_fld(3\-ESPSu). For a description of the various FEA_STAT record fields, see FEA_STAT(5\-ESPS)..I init_feastat_hdalways makes the \fIclass, nsamp,\fP and \fImean\fP record fields in theFEA_STAT file..I class_typeshould point to the beginning of a NULL-terminated array of strings that is tobe used as the.I enumsarray (the set of coded values) for the field.I class.If the value of \fIcovar\fP isnonzero, then the COVAR record field name in FEA_STAT is also created.Similarly for \fIinvcovar\fP and \fIeigen\fP..I init_feastat_hdalso defines the generic header items described in FEA_STAT. The values of the following generic header items are set equal to the values of the corresponding parameter to .I init_feastat_hd:statfield and statsize..I init_feastat_hdreturns 1 if any of its calls to .I add_fea_fld(3\-ESPSu) return an error. Otherwise, it returns 0. .I init_feastat_hdshould only be called when creating a new FEA_STAT file, after the call to .I new_header(3\-ESPSu)..PP.I put_feastat_recwrites an FEA_STAT data record pointed to by \fIdata\fR onto the stream\fIfile\fR, which should be an open ESPS FEA_STAT file. The header mustbe written out to the FEA_STAT file before calling this function. .sp .5.SH EXAMPLES.if n .ta 33.if t .ta 3i.nfstruct feastat *p; struct header *ih;ih = read_header(file); /* read FEA_STAT file header */p = allo_feastat_rec(ih); /* allocate record */if(get_feastat_rec(p,ih,file) == EOF) . . .mean[i] = p\->mean[i];.spstruct feastat *pstruct header *fea_oh;FILE *ostrm;char *class_type[] = {"voiced", "unvoiced", "silent", NULL};.sp .5fea_oh = new_header(FT_FEA);/*create FEA_STAT header for file without filters in the records*/if (init_feastat_hd(fea_oh, statfield, statsize, class_type, 1, 0, 0) != 0) ERROR_EXIT("error filling FEA header"); . . . write_header(fea_oh, ostrm);p = allo_feastat_rec(fea_oh); .p\->mean[0] = mean[0]; /* record reference */ .put_feastat_rec(p, fea_oh, ostrm);.sp .5.fi.SH DIAGNOSTICS.PPIf \fIhd\fR is not a FEA header, .I init_feastat_hdexits with an assertion failure.In the other \fIfeastat\fR functions,if \fIhd\fR does not point to a FEA header of subtypeFEA_STAT, then the program terminates with an assertion failure. In \fIget_feastat_rec\fR,if an incomplete record is read a message is printed on the standarderror output.In \fIput_feastat_rec\fR,if an I/O error occurs during the write, a message is written to standarderror and the program exits with status 1. .SH BUGSNone known..SH SEE ALSO.PP.nfcopy_header(3\-ESPSu), eopen(3\-ESPSu), new_header(3\-ESPSu), read_header(3\-ESPSu), FEA_STAT(5\-ESPS), FEA(5\-ESPS), ESPS(5\-ESPS).fi.SH AUTHORAjaipal S. Virdy.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?