3 ms·
In 1999 when MP3 was getting attention, I tried to do this. I encoded a file, then inverted it, and mixed it back into the original. It didn't cancel anything
by gwbas1c 2y ago
In 1999 when MP3 was getting attention, I tried to do this. I encoded a file, then inverted it, and mixed it back into the original.
It didn't cancel anything out.
The reason: Mp3 dramatically alters phase. Because all the phases are different, it's hard to naively determine how the signal is altered.
Years later, I took the time to write a series of tools to investigate lossy audio: https://andrewrondeau.com/blog/2016/07/deconstructing-lossy-audio-the-case-for-lossless https://andrewrondeau.com/blog/2016/07/deconstructing-lossy-...
- tecleandor 2y agoOh! Is that an artifact of Joint Stereo encoding ?
- gwbas1c 2y ago> Oh! Is that an artifact of Joint Stereo encoding ? I personally don't understand enough of MP3's internals to explain that. What I assume is that, because MP3 internally stores Fourier transforms in the frequency domain, instead of the time domain, it uses very few bits to store phase. This will result in phase shifts. Hopefully, someone else can give a better explanation of this than I can. Basically, think of it this way: 1: Imagine a frame of 64 16-bit samples. (1024 bits) 2: Than its converted to 32-bit floats: 64 32-bit samples. 3: Than its transformed 4: Now there are: 1 DC bias 32-bit float, where phase is 0, and 32 frequency amplitude floats, and 32 phase floats. (The other 31 frequency/phase pairs are duplicates and don't need to be stored.) These floats need to be quantized so that there are many less bits. Some of it can happen by using very few bits to store phase, and some of it can happen by using less bits to store amplitudes. Again, someone else can probably explain this better than I can.
- tecleandor 2y agoInteresting. In a quick internet search seems like people finds a small phase shift on MP3 enconding, but I haven't found details on why. Haven't had much time to find it, though...
- gwbas1c 2y agoSpeculation on my part: Let's assume an MP3 stores 8 sample Fourier transforms, overlapping via windowing. 1: Start with 8 16-bit samples. (For a total of 128 bits from the original CD) 2: Convert to 32 bit float 3: Run a forward Fourier transform 4: Now you're in the frequency domain 5: Keep the amplitude for the 0th frequency bucket. Quantize at 8 bit with companding. (This keeps mid-range frequencies, where the ear is most sensitive, generally lossless.) 6: Apply an exponential function to the higher frequencies amplitude (slots 1, 2, 3, and 4) so that very quiet highs are discarded. Then quantize the highs at 6 bit. 7: We will ignore the phase. Remember that slots 5-7 are just copies of 1-3 8: Now, with slot 0 at 16-bit, and slots 1-4 at 6-bit, the window is a total of 32 bits. Because of windowing, each Fourier transform is crossfaded. (Basically, the first 8-sample transform is at sample 0, the next is at sample 4, the next is at sample 8, and each is cross-faded.) This means that each the ratio of bits is (32 + 32) / 128: 0.5. Further compression (by storing the difference between windows) can probably get to around 0.25
- vagab0nd 2y agoWhy can't you convert the wave into frequency domain and compare that?