Truncate UPPER bits in Audacity -- how?

Discussion in 'Audio Hardware' started by Eno_Fan, Apr 5, 2021.

Thread Status:
Not open for further replies.
  1. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    It's an experiment, I'm not just cloth-eared! What I want to do is remove the upper 16 bits from a 24 bit file to see what, if anything is audible in what remains. Preferably in Audacity, as that's what I've got.

    Any ideas?
     
  2. Apesbrain

    Apesbrain Forum Resident

    Location:
    East Coast, USA
    In Audacity "Preferences" (CTRL+P), go to "Quality" and disable dither in both instances. Open original 24-bit file and export as 16-bit. Import the new 16-bit file along side your original 24-bit and invert it. "Mix & Render" to new file to hear any difference.

    I assume that is the essence of your experiment. If you simply want to truncate 24 bits to 8, then open the original 24-bit file and export as 8-bit WAV. Of course, the 8-bit file will be plainly audible.
     
  3. Ripblade

    Ripblade Forum Resident

    Location:
    The Six
    Interesting experiment. I did this once. Without dithering, the lower 8bits hold a record of the loud dynamics in the recording. With dithering, it is only hiss. The upper 16bits sound different too when dithered or not. Harder to describe the differences: the truncated file maintains the 'bigness' of the 24bit file, whereas the dithered file maintains the composure.
     
  4. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Hm, thanks for the replies. I'm not sure if I've asked the wrong question and haven't been understood or if I just haven't understood in turn! Perhaps I got it backwards -- what I'd like to do is remove the 16 most-significant bits (where I assume that all the 'loud' lives) and just keep the 8 least-significant ones (where I thus assume all the 'quiet' lives). Unless I've misunderstood the first reply, how does taking all the 'loud' and inverting it reproduce what lies in the 'quiet'...?
     
  5. Ripblade

    Ripblade Forum Resident

    Location:
    The Six
    The inverted is mixed 50-50 with uninverted. They cancel, leaving only the unaltered lower 8bits.
     
  6. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Thanks for the clarification -- so if I do this I get to actually listen to the output (with/without dither) rather than simply see if it nulls..?
     
  7. Ripblade

    Ripblade Forum Resident

    Location:
    The Six
    Correct. You'll have to boost the volume just to hear anything. Quite a bit, actually...
     
  8. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Indeed -- I just tried this and the render was silent at maximum gain, not even noise. I dropped it into the SPEC analyser to see if I could see what I couldn't hear, and got nothing there either. The test subject was a 24-bit rip of a 15 ips Production Master and this experiment appears to show that 16-bit captures it in its entirety...

    Thanks to you both for the help!
     
    grbluen and Ripblade like this.
  9. Ripblade

    Ripblade Forum Resident

    Location:
    The Six
    Interesting. It has been suggested that noise from analogue sources is enough to apply dither (self dither) without adding any additional. In my case it was a vinyl rip of a digital recording that clearly showed differences between truncation and dithering. So vinyl noise alone is not enough but it appears tape noise is enough.
     
  10. Mal

    Mal Phorum Physicist

    However loud or quit a signal is, it will pass through 0 volts twice every cycle (for the fundamental, anyway).

    So, if you sample the amplitude then attempt to zone in on the quiet stuff (close to 0 volts) you will also find data related to the louder stuff.

    In effect you are simply hard limiting the audio way beyond a reasonable ammount.


    Again, all signals must be referenced to something (ground) - a signal encoded in a 16-bit file cannot appear from a 24-bit noise floor out of nowhere. It must be amplified to the new sample values to match the 24-bit file, raising its noise-floor and introducing more noise in the process (rounding errors).
     
    Last edited: Apr 5, 2021
  11. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Pardon?
    If there's an answer to my question in there, can you point out where it is please. Even better, put it in continuous prose so that a simple non-physical scientist can understand it...
     
  12. Mal

    Mal Phorum Physicist

    Apologies!

    You are asking if the quiet content can be isolated from the rest of a 24-bit track by pulling out only the lowest 8-bits - I'm trying to explain that the signal is not separable in this way since low voltage amplitudes will be sampled for loud signals as well as quiet ones. In other words, what you are left with is the most clipped track possible (almost).

    Of course, the bottom 8-bits of the 24-bit audio is mostly below the noise-floor anyway - but you want to know what that sounds like and I can relate to that!


    The problem with the method suggested (take the difference between a 24-bit file and its truncated 16-bit offspring) is that the 16-bit file has a noise floor as high as the bottom 8-bits of the 24-bit file. So, when you perform the subtraction (combining the 24-bit file and 16-bit file with one inverted) you end up with just the 16-bit noise floor and anything there had been in the bottom 8-bits of the 24-bit file is now lost.
     
    Last edited: Apr 6, 2021
    jesterthejedi likes this.
  13. Apesbrain

    Apesbrain Forum Resident

    Location:
    East Coast, USA
    If you've now been made nervous about your conclusion, another way to test for audible differences is to load both the 24-bit and 16-bit files created above into foobar2000, apply ReplayGain, and run "ABX Comparator". Run a trial or two with speakers and with headphones and let us know your results.

    16-bit audio is capable of capturing a minimum 96 dB of signal/noise. 15 IPS RTR will have a S/N in the mid 60s-low 70s (up to 10 dB more if dbx or Dolby NR is used). Quality RTR tape will, however, push the limits of 44.1 kHz sampling, if you are capable of hearing up there and your program contains any such content to be heard.

    P.S. Both vinyl surface noise and magnetic tape hiss are plenty enough to provide "natural" dither. 16-bit digital dither is at least 16 dB lower than either.
     
    Robert C and grbluen like this.
  14. Ripblade

    Ripblade Forum Resident

    Location:
    The Six
    How do you account for the differences between the truncated and dithered examples of the digital vinyl record I mentioned above? When viewed in Izotope's spectrogram, the music dynamics ... especially percussion...was visible without adding gain. With 60db gain applied the music itself was audible through considerable noise. By similar observation the dithered file contained only noise. I assumed the dither was raising the 24bit noise floor to 16bits before truncation, effectively erasing all information below 16bits.
     
  15. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    If this is correct, then the experiment showed nothing at all (worse, potentially a false-negative). The reasoning seems to be sound, so I guess I should consider that the OP question remains unanswered. I wasn't terribly attracted to the suggested inversion method and I'd much rather do it the way planned -- chop off the 16 most-significant bits.

    There must be a program that can do this, surely.

    Anyone..?
     
  16. Jimi Floyd

    Jimi Floyd Forum Resident

    Location:
    Pisa, Italy
    I find this question (the original OP one) very interesting. Now I also want to hear a Hi-rez 24-bit file with the most significant 16 bits zeroed. Just to hear "it". I like the idea.
     
  17. Mal

    Mal Phorum Physicist


    The reason this is not an option is that chopping columns off a number from the left has no valid mathematical operation equivalent - the process corrupts numbers larger than the chop off point. Adding zeros to the left does nothing, of course.

    I wouldn't play a file processed in this way in case the DAC tries to reproduce it...


    Chopping off colums from the right is fine since it just represents division (by base^n where n is the number of columns removed) without keeping the remainder (dither helps reduce this rounding error). Similarly, adding zeros to the right simply multiplies the number in question (by base^n where n is the number of zeros [columns] added).
     
    Last edited: Apr 7, 2021
  18. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Explanation is again rather opaque, but I would question the statement itself as it seems that what you're suggesting precludes what is done with HDCD/playing-with-the-LSB operations. Why should LSB-manipulation be permissible but MSB-tuncation not. I don't follow...

    Edit:

    Ok, I just looked up bit-numbering and positional notation and better understand what you're saying now. Yet, by analogy, why does truncating 123.456 three-places from the left not still produce a mathematically-valid .456 result?
     
    Last edited: Apr 7, 2021
  19. Mal

    Mal Phorum Physicist

    Not sure I understand the question.

    Take an integer in base 10, say 10386401.

    If I remove, say, 3 columns from the right, I get 10386 which is the original number simply divided by 1000 (base^3), ignoring the fractional leftover (0.401 in this case). Adding back the 3 columns (as zeros) give us 10386000 which only differs from the original by a small proportion.

    Instead, lets remove 3 columns from the left of the integer. This gives us 86401 which is no use as a representation of the original number. Adding back the missing columns with zero doesn't help restore an approximation of the original value.



    The second example is what removing the top 16-bits from a 24-bit file does - it corrupts the data rather than scaling which is what happens in the first example (rounding errors notwithstanding).
     
  20. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    It would be easiest to do this in a brute force operation on the file itself, replacing the higher order bytes with bytes of 00000000. This bit of code approaches one method.
    Reading 24-bit samples from a .WAV file
     
    Kyhl likes this.
  21. Mal

    Mal Phorum Physicist


    Truncating 774.455 this way will give you .455

    774.455/123.456=6.273125648

    .455/.456=0.99780701754


    After your truncation, the ratio between the two numbers has been horribly mangled.



    Compare this with truncating from the right instead:

    774/123=6.29268292683


    The original ratio is preserved fairly well.
     
  22. Eno_Fan

    Eno_Fan Staring into the abyss: Brockman BIF, Pilbara WA Thread Starter

    Location:
    Izieu, France
    Hm, so inverting works, but actually doesn't, and what I actually want to do isn't possible at all (although there is now a suggestion of a brute-force method, that may do it but may or may not give a meaningful result).

    So, I'm not any farther and I don't think that the OP has been answered; if this isn't possible, as Mal suggests, how do digital volume controls work? It doesn't matter how many times you over-sample before applying the reduction -- you're still removing bits from the top of the scale (and doing so without leaving the bottom of that scale "...horribly mangled")
     
  23. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    Quick theoretical thought.

    Make a WAV file with white noise at 1/3 max level. (Figure out 1/3 max level of a 24-bit file!) That will make a WAV file with only exactly filled lower 8 bits.
    Subtract that file from your music file and save it. That leaves only the higher 16 bits.
    Subtract that higher 16 bits file from your music file. That leaves only the lower 8 bits.

    I know there's a flaw in this, so someone figure that out and explain please.
     
  24. Mal

    Mal Phorum Physicist

    Scaling a sample set isn't the same as removing or adding bits outside of a mathematical operation. It's just multiplication or division to a given precision. Just because bits change in these processes it doesn't mean you can change bits at will and hope to retain the information stored in those samples (their relative values). You can perform mathematical operations on the set any way you want - until the information is lost if you like - but you can't corrupt the information by means outside of mathematical operations without breaking the sampling theorem and making garbage.
     
    jesterthejedi likes this.
  25. Mal

    Mal Phorum Physicist

    "Subtract that file from your music file and save it. That leaves only the higher 16 bits."

    This step will simply add the noise you made to the music file, increasing the noise floor by a factor of √2 (or so, depending on the noise characteristics of both files).
     
Thread Status:
Not open for further replies.

Share This Page

molar-endocrine