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

📄 copysps.1

📁 speech signal process tools
💻 1
字号:
.\" Copyright (c) 1987-1990 Entropic Speech, Inc..\" Copyright (c) 1990-1996 Entropic Research Lab, Inc. All rights reserved..\" @(#)copysps.1	3.21 4/2/97 ESI/ERL.ds ]W (c) 1996 Entropic Research Laboratory, Inc..TH COPYSPS 1\-ESPS 4/2/97.SH NAMEcopysps \- copies selected records of an ESPS file to a new ESPS file.SH SYNOPSIS.B copysps[.BI \-x " debug_level"] [.BI \-f] [.BI \-r " range"] [.BI \-g " gen_range"] [.BI \-s " time_range"] [.B \-z] [.I " infile"].I " outfile".SH DESCRIPTION.PP.I Copyspscopies selected records of an ESPS file to another ESPS file.If .I outfileexists, then the selected records of.I infileare appended to.I outfileprovided that the input file and the output file are compatible (seebelow for details).If .I outfiledoesn't exist, it is created.Appending data to .I infileis not allowed.  If \fIoutfile\fP is "\-", then stdout is used as output.  If a singlefile name is given on the command line, \fIcopysps\fP uses that nameas the output file and retrieves the input file from ESPS Common (seeEXAMPLES).Note that reading stdin is not supported..PPFor FEA_SD files, additional capabilites are offered by \fIcopysd\fP (1\-\s-1ESPS\s+1), which permits scaling the data and changing the numerical data type.  .PPIf \fIoutfile\fP already exists, then \fIcopysps\fP checks the inputfile header and the output file header for compatibility.  Two ESPSfiles are considered compatible if they satisfy the followingconditions:.IP "For ESPS FEA files:"Feature header items fea_type, field count, names, sizes, ranks,types, and enums must be the same in both files.  If a field is aderived field, then the names pointed to by srcfields must also agreein both files.  Since \fIcopysps\fP does not require compatibility ofgeneric header items (indeed, none are copied from the input to theoutput file if the output file exists already), you should be carefulwhen copying records of FEA_SD, FEA_ANA, FEA_SPEC, FEA_STAT, and FEA_VQ files.Refer to section 5 man pages for more information about these special feature files. .IP "For ESPS FEA_SD files:"The sampling rate of both files must be the same.  .IP "For ESPS SPEC files:"Spectral header items order_vcd, order_unvcd, spec_an_meth, dcrem,voicing, freq_format, spec_type, and contin must all be the same forboth files.  If win_type, sf, spec_an_meth, or dcrem are not the samein both files, then a warning message is printed on stderr and in thecomment field of the output file.  (Note: SPEC files are obsolete and have been replaced by FEA_SPEC files.)  .IP "For ESPS FILT files:"Filter header items max_num, max_den, func_spec, nbands, npoints,nbits, type, bandedges, points, gains, and wts must all be the samein both files..IP "ESPS SCBK files not supported, yet.".PPWhen updating an existing file without the \fB-f\fR option, atemporary file is generated in the directory specified by theenvironment variable ESPS_TEMP_PATH (default /usr/tmp).  The operationwill be faster if the destination file is on the same file system asESPS_TEMP_PATH.  This is not a significant difference unless thedestination file is very large..SH OPTIONSThe following options are supported:.TP.BI \-fThis option causes a fast copy to be done.  This is done by appendingthe selected records onto the end of the destination file.Use of this option causes embedded headers not to be included in theoutput file.  Also, the command line is not saved as a comment in theoutput header (the output header size cannot change).  However, notethat \fIcomment\fP(1\-ESPS) can always be used to add comments to anexisting ESPS file.This option should not be used to produce archival files where theentire processing history is needed..br.spIf the header version (\fIcommon.hdvers\fR) is not the same for theinput and output file, then a fast copy is not done.  This is becausethe size or the exact format of the header might be different and thewrite may fail.   The program checks the versions, and simply turnsthe \fB\-f\fR flag off if the versions do not match..spNote that two segment labeled files are not compatible unless they bothrefer to the same set of sampled data files.  Also, if you use copyspsto copy tagged records to a tagged file, it will become difficult todetermine which file the output tags refer to in cases where the inputfile has tags refering to a different file than the tags in the outputfile.  To deal with such problems for now, use select instead ofcopysps..TP.BI \-r " start:end".TP.BI \-r " start:+incrDetermines the range of data records to process.  In the first form, apair of unsigned integers gives the first and last points of the range.  If .I startis omitted, 1 is used.  If .I endis omitted, the last point in the file is used.  The second form isequivalent to the first with .I "end = start + incr"..TP.BI \-g " range"Select a "generic" range of records to be processed.  The default isall the records in \fIinfile\fP. (See.I grange_switch(3\-ESPS) for full details of generic range specification.).TP.BI \-s " start_time:end_time".TP.BI \- " start_time:+time_incrDetermines the range of records  to be copied from \fIinfile\fP by in units of time (seconds).  In the first form, a pair ofsigned real numbers gives the start and end time of the range. If .I start_timeis omitted, the first record is used. .I end_timeis omitted, the last record in the file is used.  The second form isequivalent to the first with .I "end_time = start_time + time_incr"..TP.BI \-x " debug_level"Only debug level 1 is defined in this version;this causes several messages to be printed.The default level is zero, which causes no debug output..TP.B \-zSuppresses messages that inform the user when any of the inputfilename, the starting record, or number of records is taken from ESPS Common (see ESPS COMMON).  .SH ESPS PARAMETERSThe ESPS parameter file is not read..SH ESPS COMMON.PPESPS Common processing may be disabled by setting the environment variableUSE_ESPS_COMMON to "off".  The default ESPS Common file is .espscom in the user's home directory.  This may be overidden by settingthe environment variable ESPSCOM to the desired path.  User feedback ofCommon processing is determined by the environment variable ESPS_VERBOSE,with 0 causing no feedback and increasing levels causing increasinglydetailed feedback.  If ESPS_VERBOSE is not defined, a default value of 3 isassumed..PPThe following items are read from the ESPS Common File provided thatonly one input file or no input file is given on the command line andprovided that standard input isn't used.  .IP.I "filename \- string".IPThis is the name of the input file.  If no input file is specified on the command line, \fIfilename\fP is taken to be theinput file.  If an input file is specified on the command line, that input file name must match \fIfilename\fP or the other items (below) are not read from Common. .IP.I "start \- integer".IPThis is the starting point in the input file to begin copying.  It is not read if the \fB\-r\fP option is used.  .sp.I "nan \- integer".IPThis is the number of points to copy from the input file.  It is notread if the \fB\-r\fP option is used.  A value of zero means the lastpoint in the file..sp.PPAgain, the values of \fIstart\fR and \fInan\fR are only used if theinput file on the command line is the same as \fIfilename\fP in thecommon file, or if no input file was given on the command line.  If\fIstart\fR and/or \fInan\fR are not given in the common file, or ifthe common file can't be opened for reading, then \fIstart\fRdefaults to the beginning of the file and \fInan\fR defaults to thenumber of points in the file..PPThe following items are written into the ESPS Common file:.IP.I "start \- integer".IPThe starting point from the input file..sp.I "nan \- integer".IPThe number of points in the selected range..sp.I "prog \- string".IPThis is the name of the program (\fIcopysps\fP in this case)..sp.I "filename \- string".IPThe name of the input file..PPThese items are not written to ESPS COMMON if the output file is <stdout>..SH ESPS HEADERIf the output file is new (i.e. not appending to an existing file)then the source ESPS header structure is copied into the new fileheader (including generic header items).  For exiting output files,the input ESPS file name is added to the list of sources.  The commandline and compatibility warnings, if any, are added in the commentfield of the header.  .PPAlso, if the output file is new and the generic header item\fIrecord_freq\fP exists in the input file, the generic header item\fIstart_time\fP is written in the output file.  The value written iscomputed by taking the \fIstart_time\fP value from the header of theinput file (or zero, if such a header item doesn't exist) and addingto it the offset time (from the beginning of the input file) of thefirst record processed.  If \fIrecord_freq\fP doesn't exist in theinput file, \fIstart_time\fP is not written in the output file.  If itexists in the input file header, the generic header item\fIrecord_freq\fP is copied to the output file header.  This itemgives the number of records per second of original data analyzed..PPIf the output file already exists and it is is being appended to,\fIstart_time\fP is not modified and the \fIrecord_freq\fPvalues in the two files are checked for agreement. If they agree,no change is made to it; If they don't agree, the \fIrecord_freq\fPvalue is changed to zero..PPIn update mode, the input and the output files must both be in EDR (Entropic'sexternal data representation) or the the machine's native format..SH EXAMPLES.PPTo copy records 1 to 5, 9, and 12 to 15 from \fIfile1.sps\fP to\fIfile2.sps\fP (assuming \fIfile2.sps\fP does not already exist),type the following:.sp.nf    % copysps -r1:5,9,12:15 file1.sps file2.sps.fi.spNote that \fIfile1.sps\fP and \fIfile2.sps\fP can be any ESPS file.Only ESPS FEA, FILT, SPEC, or SCBK files can be updated (i.e. have dataappended to them).  Continuing our example above, if \fIfile2.sps\fPis an ESPS FEA file, then we can append records from \fIfile3.sps\fPby typing:.sp.nf    % copysps file3.sps file2.sps.fi.spIf only \fIfile2.sps\fP is given on the command line, as in the followingexample:.sp.nf    % copysps file2.sps.fi.spthen \fIcopysps\fP gets the input file name from ESPS Common..SH DIAGNOSTICS.PPA fatal error occurs if the input file does not exist, if it is not an ESPSfile, or if a requested range includes records that do not exist..PP.nfcopysps: no output file specified.Usage: copysps [-x debug] [\-f] [\-r gen_range] [-z] [infile] outfilecopysps: infile and outfile cannot be the same.copysps: input file name \fIinfile\fP taken from ESPS Common.copysps: fea_compat: feature fields in \fIinfile\fP and \fIoutfile\fP incompatible.copysps: cannot handle ESPS SCBK file type.copysps: cannot update ESPS file type code: \fItype_code\fPcopysps: could not open \fIoutfile\fP for appending.copysps: could not open \fItemp_file\fPcopysps: could not open \fIoutfile\fP for writing.copysps: only \fInum_rec\fP records in \fIinfile\fPcopysps: record sizes in \fIinfile\fP and \fIoutfile\fP are different.copysps: calloc: could not allocate memory for dbuf.copysps: read error on \fIinfile\fPcopysps: write error on \fItemp_file\fPcopysps: seek error on \fIinfile\fPcopysps: write error on \fIoutfile\fPcopysps: could not rename \fItemp_file\fP to \fIoutfile\fP.fiIf the versions of the headers do not match when the \fB\-f\fR flag isused, a message is printed and the \fB\-f\fR flag is turned off..SH SEE ALSO.PP.nf\fIespsenv\fR (1\-\s-1ESPS\s+1), \fImergefea\fP (1\-\s-1ESPS\s+1), \fIaddfea\fP (1\-\s-1ESPS\s+1),\fIcopysd\fR(1\-ESPS), \fIcomment\fR(1\-ESPS), \fIselect\fR(1\-ESPS),\fIgrange_switch\fR(3\-ESPSu), fea(5\-ESPS), fea_ana(5\-ESPS),fea_stat(5\-ESPS), fea_vq(5\-ESPS), filt(5\-ESPS), scbk(5\-ESPS), spec(5\-ESPS).fi.SH BUGS.PPOwing to the way that \fIgrange_switch\fR is used, this might fail on verylarge files..PPWhen a new output file is created, it will always be the same dataformat (either NATIVE or EDR) as the input.  This is considered a bugand will be changed in a future version.  Note that you can use \fIselect\fR to copythe file and convert from NATIVE to EDR..PP\fICopysps\fP does not work correctly if the input and output filesare not both in field order or both in type order.  For example, ifthe input file is in type order (the default) and the environmentvariable FIELD_ORDER is set to "on" before running \fIcopysps\fP, theoutput file will be garbage.  .PPCompressed Sphere files are not supported.  Files in Esignal format arenot supported..SH FUTURE CHANGES.PPHandle tagged and segment labeled FEA files properly.  .PPRevise to handle MIIO properly.  .SH AUTHOR.PPAjaipal S. Virdy, Entropic Speech, Inc.

⌨️ 快捷键说明

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