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

📄 shorten.1

📁 语音处理平台 可以分析语音能量 第一振峰频率等数据
💻 1
字号:
.TH SHORTEN 1 "22 Dec 1995".SH NAMEshorten \- fast compression for waveform files.SH SYNOPSIS.B shorten[-hlu] [-a #bytes] [-b #samples] [-c #channels] [-d #bytes] [-m #blocks][-n #dB] [-p #order] [-q #bits] [-r #bits] [-t filetype] [-v #version][waveform-file [shortened-file]].LP.B shorten -x[-hl] [ -a #bytes] [-d #bytes]  [shortened-file [waveform-file]].SH DESCRIPTION.IX  shorten ""  "\fLshorten\fP \(em compress waveform files".IX  files  "shorten command"  files  "\fLshorten\fP \(em compress waveform files".LP.B shorten reduces the size of waveform files (such as audio) using Huffman codingof prediction residuals and optional additional quantisation.  Inlossless mode the amount of compression obtained depends on the natureof the waveform.  Those composing of low frequencies and lowamplitudes give the best compression, which may be 2:1 or better.Lossy compression operates by specifying a minimum acceptablesegmental signal to noise ratio or a maximum bit rate.   Lossycompression operates by zeroing the lower order bits of the waveform,so retaining waveform shape..LPIf both file names are specified then these are used as the input andoutput files.  The first file name can be replaced by "-" to read fromstandard input and likewise the second filename can be replaced by "-"to write to standard output.  Under UNIX, if only one file name isspecified, then that name is used for input and the output file nameis generated by adding the suffix ".shn" on compression and removingthe ".shn" suffix on decompression.  In these cases the input file isremoved on completion.  The use of automatic file name generation isnot currently supported under DOS.  If no file names are specified,shorten reads from standard input and writes to standard output.Whenever possible, the output file inherits the permissions, owner,group, access and modification times of the input file..SH OPTIONS.TP.BI \-a " align bytes"Specify the number of bytes to be copied verbatim before compressionbegins.  This option can be used to preserve fixed length ASCIIheaders on waveform files, and may be necessary if the header lengthis an odd number of bytes..TP.BI \-b " block size"Specify the number of samples to be grouped into a block for processing.Within a block the signal elements are expected to have the samespectral characteristics.  The default option works well for a largerange of audio files..TP.BI \-c " channels"Specify the number of independent interwoven channels.  For two signals,a(t) and b(t) the original data format is assumed to bea(0),b(0),a(1),b(1)....TP.BI \-d " discard bytes"Specify the number of bytes to be discarded before compression ordecompression.  This may be used to delete header information from afile.  Refer to the -a option for storing the header information in thecompressed file..TP.BI \-hGive a short message specifying usage options..TP.BI \-lPrints the software license specifying the conditions for thedistribution and usage of this software..TP.BI \-m " blocks"Specify the number of past blocks to be used to estimate the mean andpower of the signal.  The value of zero disables this prediction andthe mean is assumed to lie in the middle of the range of the relevantdata type (i.e. at zero for signed quantities).   The default value isnon-zero for format versions 2.0 and above..TP.BI \-n " noise level"Specify the minimum acceptable segmental signal to noise ratio in dB.The signal power is taken as the variance of the samples in the currentblock.  The noise power is the quantisation noise incurred by coding thecurrent block assuming that samples are uniformally distributed over thequantisation interval.  The bit rate is dynamically changed to maintainthe desired signal to noise ratio.  The default value representslossless coding..TP.BI \-p " prediction order"Specify the maximum order of the linear predictive filter.  Thedefault value of zero disables the use of linear prediction and apolynomial interpolation method is used instead.  The use of thelinear predictive filter generally results in a small improvement incompression ratio at the expense of execution time.   This is the onlyoption to use a significant amount of floating point processing duringcompression.  Decompression still uses a minimal number of floatingpoint operations.Decompression time is normally about twice that of the defaultpolynomial interpolation.  For version 0 and 1, compression time islinear in the specified maximum order as all lower values are searchedfor the greatest expected compression (the number of bits required totransmit the prediction residual is monotonically decreasing withprediction order, but transmitting each filter coefficient requiresabout 7 bits).   For version 2 and above, the search is started atzero order and terminated when the last two prediction orders give alarger expected bit rate than the minimum found to date.   This is areasonable strategy for many real world signals - you may revert backto the exhaustive algorithm by setting -v1 to check that this worksfor your signal type..TP.BI \-q " quantisation level"Specify the number of low order bits in each sample which can bediscarded (set to zero).  This is useful if these bits carry noinformation, for example when the signal is corrupted by noise..TP.BI \-r " bit rate"Specify the expected maximum number of bits per sample.  The upper boundon the bit rate is achieved by setting the low order bits of the sampleto zero, hence maximising the segmental signal to noise ratio..TP.BI \-t " file type"Gives the type of the sound sample file as one of{ulaw,alaw,s8,u8,s16,u16,s16x,u16x,s16hl,u16hl,s16lh,u16lh}.  ulaw isthe natural file type of ulaw encoded files (such as the default sun .aufiles) and alaw is a similar byte-packed scheme.  All the other typeshave initial s or u for signed or unsigned data, followed by 8 or 16 asthe number of bits per sample.  No further extension means the data isin the natural byte order, a trailing x specifies byte swapped data, hlexplicitly states the byte order as high byte followed by low byte andlh the converse.  The default is s16, meaning signed 16 bit integers inthe natural byte order.Specific optimisations are applied to ulaw and alaw files.  If losslesscompression is specified with ulaw files then a check is made that thewhole dynamic range is used (useful for files recorded on a SparcStationwith the volume set too high).  Lossless coding of both file types usesan internal format with a monotonic mapping to linear.  If lossycompression is specified then the data is internally converted tolinear.  The lossy option "-r4" has been observed to give littledegradation..TP.BI \-uThe ulaw standard (ITU G711) has two codes which both map onto the zerovalue on a linear scale.   The "-u" flag maps the negative zero onto thepositive zero and so yields marginally better compression for formatversion 2 (the gain is significant for older format versions)..TP.BI \-v " version"Specify the binary format version number of compressed files.   Legalvalues are currently 1 and 2, higher numbers generally giving bettercompression.   Detection of format version on decode is automatic..TP.BI \-x " extract"Reconstruct the original file.  All other command lineoptions except -a and -d are ignored..SH METHODOLOGYshorten works by blocking the signal, making a model of each block in orderto remove temporal redundancy, then Huffman coding the quantised predictionresidual..SS BlockingThe signal is read in a block of about 128 or 256 samples, andconverted to integers with expected mean of zero.  Sample-wise-interleaveddata is converted to separate channels, which are assumed independent..SS DecorrelationFour functions are computed, corresponding to thesignal, difference signal, second and third order differences.  Theone with the lowest variance is coded.  The variance is measured bysumming absolute values for speed and to avoid overflow..SS CompressionIt is assumed the signal has the Laplacian probabilitydensity function of exp(-abs(x)).  There is a computationallyefficient way of mapping this density to Huffman codes, The code is intwo parts, a run of zeros, a bounding one and a fixed number of bitsmantissa.  The number of leading zeros gives the offset from zero.Signed numbers are stored by calling the function for unsigned numberswith the sign in the lowest bit.  Some examples for a 2 bit mantissa:.LP.RS.ft B.nf100        0101        1110        2111        30100       40111       700100      80000100    16.fi.ft R.REThis Huffman code was first used by Robert Rice, for more details seethe technical report CUED/F-INFENG/TR.156 included with the shortendistribution as files tr154.tex and tr154.ps..SH SEE ALSO.BR compress (1), pack (1)..LP.SH DIAGNOSTICS.LPExit status is normally 0.  A warning is issued if the file is not properlyaligned, i.e. a whole number of records could not be read at the endof the file..SH BUGSLarge values of '-c' or '-b' cause MS-DOS to throw a wobbly.Presumably this is a (lack of) memory management problem..LPAn easy way to test shorten for your system isto use "make test", if this fails, for whatever reason, please report it..LPNo check is made for increasing file size, but valid waveform filesgenerally achieve some compression.  Even compressing a file of randombytes (which represents the worst case waveform file) only results in asmall increase in the file length (about 6% for 8 bit data and 3% for 16bit data).  There is one condition that is know to be problematic, thatis the lossy compression of unsigned data without mean estimation -large file sizes may result if the mean is far from the middle rangevalue.  For these files the value of the -m switch should be non-zero,as it is by default in format version 2..LPThere is no provision for different channels containing different data types.Normally, this is not a restriction, but it does mean that if lossy codingis selected for the ulaw type, then all channels use lossy coding..LPIt would be possible for all options to be channel specific as in the -roption.   I could do this if anyone has a really good need for it..LPSee the file "change.log" for a history of bug fixes..LPPlease mail me immediately at the address below if you do find a bug..SH AVAILABILITYThe latest version can be obtained by anonymous FTP fromsvr-ftp.eng.cam.ac.uk, in directory comp.speech/coding.  The sourcesare available for UNIX machines in files shorten.tar.Z andshorten.tar.gz and for DOS machines as file shorten.zip.  Alldistributions contain a DOS executable..SH AUTHORCopyright (C) 1992-1995 by Tony Robinson and SoftSound Ltd(ajr@softsound.com).LPShorten is available for non-commercial use without fee.   See the LICENSEfile for the formal copying and usage restrictions.

⌨️ 快捷键说明

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