search for: samplemidpoint

Displaying 9 results from an estimated 9 matches for "samplemidpoint".

2012 Feb 17
3
Regain play analysis patches
...: > > 1. Use bc(1) to compute the raw samples > 2. Use perl(1) to compute the raw samples > > To generate raw unsigned samples using bc(1) for example: > > samplerate = 1000; > duration = 2; > bitspersample = 24; > > samplerange = 2 ^ (bitspersample-1) - 1; > samplemidpoint = 2 ^ (bitspersample-1); > > pi = 4 * a(1); > > scale = 18; > obase = 16; > > for (ix = 0; ix < duration * samplerate; ++ix) { > ? sample = samplemidpoint + samplerange * s(2 * pi * ix / samplerate); > ? s = scale; > ? scale = 0; > ? sample /= 1; > ? sample...
2014 Nov 30
4
awk vs. mawk
...e = '$1'; + $AWK ' + BEGIN { + tone = 1000; + duration = 1; + samplerate = '$1'; + pi = 4 * atan2(1,1); - tone = 1000; - duration = 1; - bitspersample = 24; + bitspersample = 24; + amplitude = 2^bitpersample - 1; - samplemidpoint = 1; - for (sps = 0 ; sps < bitspersample - 1 ; sps++) { - samplemidpoint *= 2; + for (s = 0; s < duration * samplerate; s++) { + sample = sin(2 * pi * tone * s / samplerate); + sample = int(amplitude * sample); + for (b = 0; b < bitspersample/8; b++) { + printf("%c&quo...
2012 Feb 20
0
Regain play analysis patches
...(1) ? It is specified as one of the standard commands in the LSB : http://refspecs.linuxfoundation.org/LSB_1.0.0/gLSB/command.html Earl ??? awk -- ' ??? BEGIN { ??????????? samplerate = 8000; ??????????? tone = 1000; ??????????? duration = 1; ??????????? bitspersample = 24; ??????????? samplemidpoint = lshift(1, (bitspersample-1)); ??????????? samplerange = samplemidpoint - 1; ??????????? pi = 4 * atan2(1,1); ??????????? for (ix = 0; ix < duration * samplerate; ++ix) { ??????????????????? sample = sin(2 * pi * tone * ix / samplerate); ??????????????????? sample *= samplerange; ????????????...
2014 Dec 03
0
awk vs. mawk
...correctly. tonegenerator () { - # When using GAWK, use --lint=posix to identify non-POSIX awk usages. - $AWK -- ' + awk -- ' BEGIN { samplerate = '$1'; tone = 1000; duration = 1; bitspersample = 24; - - samplemidpoint = 1; - for (sps = 0 ; sps < bitspersample - 1 ; sps++) { - samplemidpoint *= 2; - } - + samplemidpoint = 2^(bitspersample - 1); samplerange = samplemidpoint - 1; pi = 4 * atan2(1,1); @@ -127,7 +112,7 @@ tonegenerator () } }...
2014 Dec 10
1
awk vs. mawk
...GAWK, use --lint=posix to identify non-POSIX awk usages. > - $AWK -- ' > + awk -- ' > BEGIN { > samplerate = '$1'; > > tone = 1000; > duration = 1; > bitspersample = 24; > - > - samplemidpoint = 1; > - for (sps = 0 ; sps < bitspersample - 1 ; sps++) { > - samplemidpoint *= 2; > - } > - > + samplemidpoint = 2^(bitspersample - 1); > samplerange = samplemidpoint - 1; > > pi = 4 * atan2(1,1); > @@ -127,7 +112,7 @@ tonegener...
2012 Feb 15
4
Regain play analysis patches
Brian Willoughby wrote: > What about using the C library sin() and cos() functions to generate > the test audio instead of sox? I did not see a description of how > the test files are generated, so maybe this is easy or maybe it is > hard. The benefit of shipping the test audio generation source code > around with the FLAC sources is that the tests won't break when
2014 Dec 11
2
awk vs. mawk
...correctly. tonegenerator () { - # When using GAWK, use --lint=posix to identify non-POSIX awk usages. - $AWK -- ' + awk -- ' BEGIN { samplerate = '$1'; tone = 1000; duration = 1; bitspersample = 24; - - samplemidpoint = 1; - for (sps = 0 ; sps < bitspersample - 1 ; sps++) { - samplemidpoint *= 2; - } - + samplemidpoint = 2^(bitspersample - 1); samplerange = samplemidpoint - 1; pi = 4 * atan2(1,1); @@ -127,7 +112,7 @@ tonegenerator () } }...
2012 Feb 26
3
PATCH: Add test for metaflac --add-replay-gain
...ates which have specific filter table entries +# and verify that harmonics can be processed correctly. + +tonegenerator () +{ +??? awk -- ' +??? BEGIN { +??????????? samplerate = '$1'; + +??????????? tone = 1000; +??????????? duration = 1; +??????????? bitspersample = 24; + +??????????? samplemidpoint = lshift(1, (bitspersample-1)); +??????????? samplerange = samplemidpoint - 1; + +??????????? pi = 4 * atan2(1,1); + +??????????? for (ix = 0; ix < duration * samplerate; ++ix) { +??????????????????? sample = sin(2 * pi * tone * ix / samplerate); +??????????????????? sample *= samplerange; +????...
2012 Feb 17
0
Regain play analysis patches
...at will work well enough out of the box. Here are two ideas: 1. Use bc(1) to compute the raw samples 2. Use perl(1) to compute the raw samples To generate raw unsigned samples using bc(1) for example: samplerate = 1000; duration = 2; bitspersample = 24; samplerange = 2 ^ (bitspersample-1) - 1; samplemidpoint = 2 ^ (bitspersample-1); pi = 4 * a(1); scale = 18; obase = 16; for (ix = 0; ix < duration * samplerate; ++ix) { ? sample = samplemidpoint + samplerange * s(2 * pi * ix / samplerate); ? s = scale; ? scale = 0; ? sample /= 1; ? sample; ? scale = s; } Are you ok with bc(1) ??? Or would you p...