aubitswap swaps bits in each sample of a 16-bit PCM stream.
The input is read from the files whose names are given on the command
line or, if none, standard input.
The output is written to standard output.
Which bits are swapped is specified with the -s option.
For example, to swap bit 15 with bit 14 and bit 0 with bit 5, use
"-s 14,15,0,5".
adjacent-sin-freq.ogg
A sine sweep from 20 Hz to 5 kHz, first with no effect, then with adjacent bits of increasing weight swapped (8-9, 10-11, 12-13, 13-14 and finally 14-15).
As the order of the bits increases, the effect becomes more evident. As the frequency goes up, it degenerates into aliasing.
| Bits 10 and 11 swapped | |
| Bits 12 and 13 swapped | |
| Bits 13 and 14 swapped | |
| Bits 14 and 15 swapped |
adjacent-sin-amp.ogg
The input signal is a 100 Hz sine whose amplitude is brought linearly from 0 to 1 in 3 seconds then back to 0 in 0.5 seconds. It's first heard without any effect, then with adjacent bits of increasing weight swapped (8-9, 10-11, 12-13, 13-14 and finally 14-15).
For low order bits, the changes are quieter but faster for a given da/dt.
The result of swapping bits 13 and 14 :
| Amplitude 0.25 | |
| Amplitude 0.50 | |
| Amplitude 0.75 | |
| Amplitude 1.00 |
any-two-sin.ogg
All 120 possible bit swaps : 0-1 through 0-15, then 1-2 through 1-15 and so forth until 14-15. The left part of the table below has been omitted because it's uninteresting (all near-sines).
| 10 | 11 | 12 | 13 | 14 | 15 | |
|
|
|
|
|
| 0 |
|
|
|
|
|
| 1 |
|
|
|
|
|
| 2 |
|
|
|
|
|
| 3 |
|
|
|
|
|
| 4 |
|
|
|
|
|
| 5 |
|
|
|
|
|
| 6 |
|
|
|
|
|
| 7 |
|
|
|
|
|
| 8 |
|
|
|
|
|
| 9 |
|
|
|
|
| 10 | |
|
|
|
| 11 | ||
|
|
| 12 | |||
|
| 13 | ||||
| 14 |
aubitswap.cc
Makefile
This is http://www.teaser.fr/~amajorel/aubitswap/, last
updated AYM 2006-05-14