History

stat doc updates

robs committed 18 years ago

Commit 7e27d2e1 parent f5fbe6c2 files · +71 −26Browse files

Unified · Split

2 files
  1. ChangeLog +1 −0
  2. soxeffect.7 +70 −26
ChangeLog+1−0
@@ -44,6 +44,7 @@ Other bug fixes: · 43 unmodified lines
44 o Fix memory leaks in effects chain when restarting effects.44 o Fix memory leaks in effects chain when restarting effects.
45 o Fix WAV write on 64-bit arch. (robs)45 o Fix WAV write on 64-bit arch. (robs)
46 o Fixed pkg-config CFLAGS. (evilynux)46 o Fixed pkg-config CFLAGS. (evilynux)
47 o Improved documentation for the `stat' effect. (robs)
47 48
48Internal improvements:49Internal improvements:
49 50
soxeffect.7+70−26
@@ -1483,34 +1483,72 @@ would typically be an number of seconds, and · 1482 unmodified lines
1483.I leeway1483.I leeway
1484should be set to zero.1484should be set to zero.
1485.TP1485.TP
1486\fBstat\fR [\fB\-s \fIn\fR] [\fB\-rms\fR] [\fB\-freq\fR] [\fB\-v\fR] [\fB\-d\fR]1486\fBstat\fR [\fB\-s \fIscale\fR] [\fB\-rms\fR] [\fB\-freq\fR] [\fB\-v\fR] [\fB\-d\fR]
1487Do a statistical check on the input file,1487Display time and frequency domain statistical information about the audio.
1488and print results on the standard error file. Audio is passed1488Audio is passed unmodified through the SoX processing chain.
1489unmodified through the SoX processing chain.
1490.SP1489.SP
1491The `Volume Adjustment:' field in the statistics1490The information is output to the `standard error' (stderr) stream and is
1492gives you the parameter to the1491calculated, where
1493.B \-v1492.I n
1494.I number1493is the duration of the audio in samples,
1495which will make the audio as loud as possible without clipping.1494.I c
1495is the number of audio channels,
1496.I r
1497is the audio sample rate, and
1498.I x\s-2\dk\u\s0
1499represents the PCM value (in the range \-1 to +1 by default) of each successive
1500sample in the audio,
1501as follows:
1502.TS
1503center;
1504lI l l.
1505Samples read \fIn\fR\^\(mu\^\fIc\fR \
1506Length (seconds) \fIn\fR\^\(di\^\fIr\fR
1507Scaled by \ See \-s below.
1508Maximum amplitude max(\fIx\s-2\dk\u\s0\fR) T{
1509The maximum sample value in the audio; usually this will be a positive number.
1510T}
1511Minimum amplitude min(\fIx\s-2\dk\u\s0\fR) T{
1512The minimum sample value in the audio; usually this will be a negative number.
1513T}
1514Midline amplitude \(12\^min(\fIx\s-2\dk\u\s0\fR)\^+\^\(12\^max(\fIx\s-2\dk\u\s0\fR)
1515Mean norm \(S1/\s-2n\s+2\^\(*S\^\^\(br\^\fIx\s-2\dk\u\s0\fR\^\(br\^ T{
1516The average of the absolute value of each sample in the audio.
1517T}
1518Mean amplitude \(S1/\s-2n\s+2\^\(*S\^\fIx\s-2\dk\u\s0\fR T{
1519The average of each sample in the audio. If this figure is non-zero, then it indicates the
1520presence of a D.C. offset (which could be removed using the
1521.B dcshift
1522effect).
1523T}
1524RMS amplitude \(sr(\(S1/\s-2n\s+2\^\(*S\^\fIx\s-2\dk\u\s0\fR\(S2) T{
1525The level of a D.C. signal that would have the same power
1526as the audio's average power.
1527T}
1528Maximum delta max(\^\(br\^\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR\^\(br\^)
1529Minimum delta min(\^\(br\^\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR\^\(br\^)
1530Mean delta \(S1/\s-2n\-1\s+2\^\(*S\^\^\(br\^\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR\^\(br\^
1531RMS delta \(sr(\(S1/\s-2n\-1\s+2\^\(*S\^(\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR)\(S2)
1532Rough frequency \ In Hz.
1533Volume Adjustment \ T{
1534The parameter to the
1535.B vol
1536effect which would make the audio as loud as possible without clipping.
1496Note: See the discussion on1537Note: See the discussion on
1497.B Clipping1538.B Clipping
1498in1539in
1499.BR sox (1)1540.BR sox (1)
1500for reasons why it is rarely a good idea to actually do this.1541for reasons why it is rarely a good idea actually to do this.
1501.SP1542T}
1502The option1543.TE
1503.B \-v1544.DT
1504will print out the `Volume Adjustment:' field's value only and
1505return. This could be of use in scripts to auto convert the
1506volume.
1507.SP1545.SP
1508The1546The
1509.B \-s1547.B \-s
1510option is used to scale the input data by a given factor. The default value1548option can be used to scale the input data by a given factor.
1511of1549The default value of
1512.I n1550.I scale
1513is the maximum value of a signed long integer (7fffffff in hexadecimal).1551is 2147483647 (i.e. the maximum value of a 32-bit signed integer).
1514Internal effects1552Internal effects
1515always work with signed long PCM data and so the value should relate to this1553always work with signed long PCM data and so the value should relate to this
1516fact.1554fact.
@@ -1521,15 +1559,21 @@ option will convert all output average values to `root mean square' · 4 unmodified lines
1521format.1559format.
1522.SP1560.SP
1523The1561The
1562.B \-v
1563option displays only the `Volume Adjustment' value.
1564.SP
1565The
1524.B \-freq1566.B \-freq
1525option calculates the input's power spectrum and prints it to standard error.1567option calculates the input's power spectrum (4096 point DFT) instead of the
1568statistics listed above.
1526.SP1569.SP
1527There is also an optional parameter1570The
1528.B \-d1571.B \-d
1529that will print out a hex dump of the1572option
1530audio from the internal buffer that is in 32-bit signed PCM data.1573displays a hex dump of the 32-bit signed PCM data
1531This is mainly only of use in tracking down endian problems that1574audio in SoX's internal buffer.
1532creep in to SoX on cross-platform versions.1575This is mainly used to help track down endian problems that
1576sometimes occur in cross-platform versions of SoX.
1533.TP1577.TP
1534\fBswap\fR [\fI1 2\fR | \fI1 2 3 4\fR]1578\fBswap\fR [\fI1 2\fR | \fI1 2 3 4\fR]
1535Swap channels in multi-channel audio files. Optionally, you may1579Swap channels in multi-channel audio files. Optionally, you may

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t