From: Jan S. <ha...@st...> - 2010-06-24 08:57:41
|
On Jun 23 12:32:49, nitin arora wrote: > Anyway, I was playing around with that awesome code you wrote up. Heh :-) > I've pasted my results with three files. > But basically: > I got statistics with Sony Sound Forge 9 and SoX 14.3.1's "stat" effect per > your modification. > The Sony appears to be scaling at (-100 to 100) range and the SoX at (-1 to > 1) range. Hence, the difference of 2 decimal places between the two outputs. There a '-s' option to the stat effect to specify scale. > I might be getting cross-eyed, but this is what I think I'm seeing: > > With the "monotest" mono file I used, the location of the Min position was > different between the 2 reports. Max position was identical. > Sound Forge 9 > monotest.wav > Cursor position (Samples) 0 > Sample value at cursor (%) 0.000 > Minimum sample position (Samples) 95,230 > Minimum sample value (%) -25.115 > Maximum sample position (Samples) 125,499 > Maximum sample value (%) 25.117 > RMS level (%) 10.203 > Average value (%) 0.000 > Zero crossings (Hz) 866.06 > > > SoX > monotest.wav > Samples read: 145530 > Length (seconds): 3.300000 > Scaled by: 2147483647.0 > Maximum amplitude: 0.251174 (sample 125499) > Minimum amplitude: -0.251149 (sample 108460) > Midline amplitude: 0.000012 > Mean norm: 0.067352 > Mean amplitude: 0.000003 > RMS amplitude: 0.102034 > Maximum delta: 0.040679 > Minimum delta: 0.000000 > Mean delta: 0.010884 > RMS delta: 0.015914 > Rough frequency: 1094 > Volume adjustment: 3.98 How does Sound Forge round the values? Because if -25.115 is a rounding of -0.251149, then the minimal value itself is the same, yet found on different positions, which is strange. > With the stereo tests, the SoX "stat" mod was giving sample values 2x that > of the Sony. That is to say the Sox stat was retrieving 2x the Sony sample > value of the channel with the lowest value for Min. > And it was retrieving 2x the Sony sample value of the channel with the > higher Max value. > > Sound Forge 9 > stereotest.wav > Left Channel Right > Channel > Cursor position (Samples) 0 > 0 > Sample value at cursor (%) -0.389 > 0.000 > Minimum sample position (Samples) 308,076 > 95,230 > Minimum sample value (%) -53.473 > -25.115 > Maximum sample position (Samples) 2,031,260 > 125,499 > Maximum sample value (%) 51.904 > 25.117 > RMS level (%) 7.375 > 2.527 > Average value (%) 0.018 > 0.000 > Zero crossings (Hz) 1,329.93 > 53.11 > > > > SoX > stereotest.wav > Samples read: 4745664 > Length (seconds): 53.805714 > Scaled by: 2147483647.0 > Maximum amplitude: 0.519044 (sample 4062520) > Minimum amplitude: -0.534734 (sample 616152) > Midline amplitude: -0.007845 > Mean norm: 0.023978 > Mean amplitude: 0.000088 > RMS amplitude: 0.055126 > Maximum delta: 0.534734 > Minimum delta: 0.000000 > Mean delta: 0.046961 > RMS delta: 0.077968 > Rough frequency: 9926 > Volume adjustment: 1.870 > > * SoX min pos = Sony sample value of 308.076 * 2 ^^^^^^^^^^^^ > * SoX max pos = Sony sample value of 2031260 * 2 ^^^^^^^^^^^^ (You mean the position, not the sample's value, right?) The min and max values and postions as reported by soundforge seem to be the same in the mono file and in the right channel of the stereo file. Where do monotest.wav and stereotest.wav come from? Also, a 3s file and a 53s file are probably small enough, can you please put them somewhere for download? Could the "*2" difference be caused simply by disagreeing on what "sample" means? In soundforge, is "sample" the sampled data for both left and right channel, or just one of them? That could be an explanation, because the values themselves are the same: 51.904 max and -53.473 min. (Which does not explain it for the mono case, however.) > I'm getting a little lost on the "stat" output vs Sony since the Sony is per > channel with non mono files. > I guess the same code modification could be done to the "stats" effect to > get the values per channel, a la the Sony. Most probably. > Sound Forge 9 > stereoswaptest.wav (this is the same as the stereotest.wav file but with the > channels swapped) > > Left Channel Right > Channel > Cursor position (Samples) 666,112 > 666,112 > Sample value at cursor (dB) -Inf. > -23.970 > Minimum sample position (Samples) 95,230 > 308,076 > Minimum sample value (dB) -12.001 > -5.437 > Maximum sample position (Samples) 125,499 > 2,031,260 > Maximum sample value (dB) -12.000 > -5.696 > RMS level (dB) -31.948 > -22.645 > Average value (dB) -138.474 > -75.074 > Zero crossings (Hz) 53.11 > 1,329.93 > Why does this report the min and max values in dB (so that I cannot directly compare it to the above)? Anyway, the positions seem to be just swapped, as expected. > SoX > stereoswaptest.wav > Samples read: 4745664 > Length (seconds): 53.805714 > Scaled by: 2147483647.0 > Maximum amplitude: 0.519044 (sample 4062521) > Minimum amplitude: -0.534734 (sample 616153) > Midline amplitude: -0.007845 > Mean norm: 0.023978 > Mean amplitude: 0.000088 > RMS amplitude: 0.055126 > Maximum delta: 0.534734 > Minimum delta: 0.000000 > Mean delta: 0.046960 > RMS delta: 0.077965 > Rough frequency: 9926 > Volume adjustment: 1.870 > > SoX min pos = Sony sample value of 308.076 * 2 + 1 > SoX max pos = Sony sample value of 2031260 * 2 > ----------------------------------------------------------- This is the same as above, because the 'stat' does on work per file, not per channel. Except the "+1", which again makes me think that "sample" means different things in these outputs (sox vs soundforge): if in sox the "samples" come as "one from the left channel, one from the right channel, etc", then the "+1" makes sense in a swapped stereo file. In soundforge, it's still the same "sample" (with left and right swapped). If this explanation is correct, then sox (as modified) and soundforge actually agree on the peaks. |