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. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    Let's imagine this or at least imagine this as I did.
    The white noise file would have 24-bit samples of
    Code:
    00000000 00000000 11111111
    Subtract that from the music file and you subtract those lower bits, leaving only the music data of the higher bits.
    As a random example sample
    Code:
    01010101 01010101 00000000
    Subtract that file from the music file and you would be left with only the lower bits of the music file.

    What have I missed? I'm not envisioning XOR or ANDs properly here and how Audacity would work this but there are no negative bits (dithering must be switched off). Subtracting a 1 bit from a 0 bit will still leave a 0 bit.
     
    Last edited: Apr 8, 2021
  2. Mal

    Mal Phorum Physicist

    How the bits are stored is up to you but they must be treated as a signed integer set where the sample values will be spread around zero. Only then will the calculations make any sense.

    The computer will normally handle a 24-bit sample as a 32-bit floating-point number reformatted so that the MSB is the sign bit.
     
  3. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    OK, but the question posed was to eliminate the higher bits. That's not floating point even if Audacity converts everything to floating point. The final WAV file or any digital audio file is not floating point.
    I think the brute force method is the simplest way to the exact answer.
    I think the audible result would be a varying level (audible volume level) of noise, rising and falling level when the original music is within that lower 8-bit volume level, and flipping phase which would not be detectable to ears.
     
  4. Angry_Panda

    Angry_Panda Pipe as shown, slippers not pictured

    If I'm understanding the intention of the OP, it's to get to a file that - to put it one way - contains only the additional resolution the 24 bit file has over the 16 bit file, or - put another way - contains the 8 least significant bits from the 24 bit file.

    I believe this is only going to result in a file of (essentially) white noise at something like -96 dBfs (dB full scale, where the maximum signal level is set to 0 dBfs). I make this claim based on the following (so if I'm way off base, somebody who understands this better than I do please correct this):

    Each bit of resolution results in an additional 6 dB S/N ratio, so a 16 bit file will have an S/N of 96 dB, and a 24 bit file will have an S/N of 144 dB. The least significant bit (LSB) is where the 'rounding' has to happen, so if I'm trying to capture a very quiet signal way down around the -96 dBfs limit in a 16 bit file, either that LSB is on or it's not - it can't be fractional. If I switch to a 24 bit format (and assuming I'm keeping my full scale point at the same level), I now have an additional 48 dB of resolution (8 more bits) and can accurately capture that -96 dB signal with those 8 bits.

    Statistically speaking, that rounding that occurs at the LSB is going to essentially be random - about half the time, it's rounding down, and the other half it's rounding up. And a truly random signal is, by definition, white noise. (Relatedly, the dither function adds very low level white noise to a digital file to ensure this happens randomly, which is psychoacoustically considered to be less objectionable, from what 'they' tell me.) Since the 16 bit file is - at the extreme of -96 dBfs levels - already white noise, subtracting any other signal from it at that same -96 dBfs level will result in more white noise. So while the additional 8 bits are adding resolution (in the form of better S/N ratio), trying to extract them the way you're proposing doesn't seem like it's going to have meaningful results.

    Like I said, this isn't exactly my forte (I've spent just enough time behind a mixing desk to be dangerous), so if someone with a better understanding can chime in to correct any errors I may have made, please do so. Also, I question how many recordings actually have a 96 dB S/N being passed to the medium - given the need to keep some headroom for peaks (digital doesn't like clipping), and noise introduced by amplification in the chain as well as ambience in the recording space, I can't believe many recordings actually reach this ideal.
     
  5. Mal

    Mal Phorum Physicist

    Brute force is the only way.

    My guess is that the resulting file will represent a signal full of discontinuities and will probably be rejected (muted) by the DAC (hopefully...).
     
  6. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    This is where I have a conceptual blockage, since I come more from the graphics world. In the digital graphics world, a color image (photo) could be (and there are lower formats), 15-bit, 16-bit, 24-bit, and now there are 32 -bit and 48 and 64 although those are not all visible image data.
    A color photo can be represented in a 15-bit graphics file (5 bits per color), or 16, or 24 (8 bits per color). For any of those formats there are the different gradations from black or full saturation of a color to none or white. The difference is the number of gradations as bit depth is higher in the higher bit files, but each format goes from black to white for example. Sometimes you can see "banding" in photo images, possibly most often in skies - the banding is the result of the different hard gradations from the number of bits or steps of gradation from black to white.
    Yet in digital audio it is said that there is more dynamic range with additional bits. With 8, 16, 24, 32 bit digital files, presumably a 64738-bit file would have a dynamic range of 10,000,000 db or something?
    Yet there are many similarities in processing digital audio vs. digital images.

    Just throwing this out there to confuse everyone and possibly blow your mind.
     
    Last edited: Apr 8, 2021
  7. JohnO

    JohnO Senior Member

    Location:
    Washington, DC
    My msg above was not directed at you - I only quoted what you said which is the correct thing for audio, but just conflicts with what I did and do with graphics.
     
  8. Angry_Panda

    Angry_Panda Pipe as shown, slippers not pictured

    No problem - I almost posted something in response about how I agreed it wasn't an exact parallel, but couldn't figure out how to phrase what I was thinking in a satisfactory manner. The short version is that since sound has to exist in time, while a still image doesn't, it makes sense that they're not directly comparable. In some respects, the audio bit depth would be the analogue (as opposed to the analog :D) to both color depth and resolution, and the sampling rate would be akin to frame rate for animation.

    The other thing complicating this is the use of dB both as a measure of absolute power (my normal listening level runs between 75-85 dB) and comparative power (the 96 and 144 dB S/N ratios), and they're not really directly interchangeable - if I'm listening to a CD with the volume set so the peak volume is 75 dB, that doesn't put the noise floor at -21 dB, since that doesn't exist. Nor would a 24 bit file have to be 48 dB louder than a 16 bit one on playback. Gotta love it when the units start making things confusing (looking at you, ounces).
     
  9. Eno_Fan

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

    Location:
    Izieu, France
    Righty-ho, so brute-force can do it and the impossible is now possible. Now we're getting somewhere. Now please recommend software rather than code!

    Incidentally, if we can do this easily with some soft, then there's scope to (re)solve the endless debate about the merits of hi-res digital (I cannot resist adding here that for my money, all digital sounds like a55 compared to the analogue source, and I add this because of the recent experience which prompted this Thread -- comparing 24-bit rips of 15 IPS analogue Production Masters, and it still didn't sound anything like as good as the Record...)
     
  10. MrRom92

    MrRom92 Forum Supermodel

    Location:
    Long Island, NY
    I will add my 2¢ into the ring - the basis of this comparison is entirely flawed unless you have any idea about the provenance of this supposed “15ips production master” - just based on your description I am under the assumption that the set of files you are referencing were not made professionally or distributed through official channels. For all you know, this tape is something somebody simply recorded off a CD and now has been transferred back to the digital domain in high res.

    There are more than a few official hi-res releases that are known (or at least strongly considered) to be flat transfers off the original master tape. Maybe start your experimentation with one of those.
     
  11. Apesbrain

    Apesbrain Forum Resident

    Location:
    East Coast, USA
    Here's another possible method using Audacity: amplify your original 24-bit file by 96 dB (allow clipping, 50 dB + 46 dB). That will move the bottom 8 bits up to the top 8 bits. Export to 24-bit WAV; all dither off. Open the exported file and amplify by -96 dB.

    Also, Wavosaur appears to have a "Truncate" function.
     
  12. Mal

    Mal Phorum Physicist

    The clipping is dealt with by replacing the clipped sample with a full scale one of the same sign. So, you get flat tops for clipped peaks instead of unpredictable drops (which is what the original idea proposed in this thread would produce).

    That reminds me of a weird clipping case on the gold promo Kamakiriad CD. It says it was noise-shaped from 20-bit to 16-bit using the SONY SBM process but Roger Nichols claims it was actually Apogee UV22.

    Anyway, whatever they did, there's a one sample offset between channels and overs appear as maximum level samples with the opposite sign to what they should have! So, you get these sharp triangles over the full range at every over - you can hear them as little ticks.

    The original CD is fine.
     
    Last edited: Apr 9, 2021
  13. harby

    harby Forum Resident

    Location:
    Portland, OR, USA
    This will give you noise with no meaning. That is, unless the audio is 16 bit sourced without translation, and then you get silence. Perhaps you want to explain what you are wanting to accomplish instead of asking a question that is the end of your thought process.

    If you zero-out the 16 MSBs of 24 bit audio, what will remain will be nonsensical noise, random and digital, uncorrelated to the audio. Noise like is used as input for hardware random number generators. It would be like measuring the length of various boards with a tape measure, coming up with measurements like 280.31cm, and then removing all the digits from your measurement except the 0.01cm digit position.
     
    Last edited: Apr 9, 2021
  14. Eno_Fan

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

    Location:
    Izieu, France
    If you want to "...add my 2¢ into the ring", make it something factual or at least related to the OP -- the "assumption" that You are under is just that. Keep your speculations regarding the provenance, resolution, and implied illegality of the files that I have and that you know nothing about to yourself and out of the thread.
     
  15. MrRom92

    MrRom92 Forum Supermodel

    Location:
    Long Island, NY

    This is directly related to the details of the experiment you brought up, and I made no implications regarding the legality of the files you have, just their provenance… Though based on your strong reaction to my comment, I think I can draw my own conclusions about that as well.
    My point is your test is flawed if there wasn’t 24 bits of audio printed to this tape in the first place. Just something to keep in mind. One doesn’t have to look very far to see that the marketplace is absolutely littered with fake “safeties” or “cutting masters”, etc. so on and so forth. Is it for a very major/well known album? Shockingly those are the ones it seems like everyone and their mother has a croatian 15IPS record company dub to sell you. It’s almost like EMI must have been giving away copies of Dark Side of The Moon like candy back in the 70’s. Be careful if god forbid you’re the person that actually paid for/owns this particular tape, and good luck with your experiment.
     
  16. Eno_Fan

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

    Location:
    Izieu, France
    For the non-trolls who engaged with the OP, I tried the Truncate function in Wavosaur, removing 96 db from the 24-bit file (i.e., reducing 24- to 8-bits) and had much more success than from the Audacity inversion. The -96 db result was, unsurprisingly, silence, but on amplifying this by the max 49 db in Audacity I got audio (blocky and bad-sounding, but audio nevertheless) that I must suppose are the 8 LSBs.

    To illustrate, here's the same experiment with a royalty-free WAV of a ride-cymbal tap (24/96) from Voxengo:

    Ride Cymbal D.wav (full-res 24/96 [11 mb])

    and here's the same wav file truncated from 24 bits to 8 bits, as described above:

    Ride Cymbal D-96db_amplified_49db.wav (truncated 8/96 file [7 mb]))

    Have a listen to both. Interesting, and convincing justification to my mind (and ears) of the merit of high-bit-rate (and -sampling) audio. I can easily hear the main tap ringing past 5 secs even on my cruddy laptop speakers, and if you look at the spectrum of this native file as seen by SPEC in the below image you can see that there's clear spectral information present at this point that's beyond the ability of 16-bit to capture (the purple colouring)...

    [​IMG]

    16 bit looks demonstrably to not be enough, after all... :)

    N.B. To really make the case for the latter you'd have to take that ride-cymbal digital file and record it to 15 IPS R2R and then re-digitise the R2R output (to prove that all that audio is captured by standard analogue studio recording techniques) before beginning this experiment. As I gave-up on digital and went back to analogue some years ago, I don't really have any skin in this experimental game and only did this to see if the HDDAP 15 IPS Production rips contained the necessary audio information to compete with vinyl, but having done so they still don't measure up to that format sound-wise. What I've certainly (re)demonstrated, if only for myself, is the jokeyness of the 16-bit standard...
     
    Last edited: Apr 10, 2021
    Jimi Floyd and Ripblade like this.
  17. Mal

    Mal Phorum Physicist


    [​IMG]


    You would need to verify whether that is the original bottom 8 bits before drawing any conclusions.


    For example:

    Truncate (at -100 dB) [Wavosaur forum comment]
     
  18. Mal

    Mal Phorum Physicist

    One problem is that the decibel conversion isn't precicely 6 dB per bit, it is 20log102 dB per bit.

    16 x 20log102 = 96.3295986.....[etc.] dB



    This is where a brute-force bitwise method comes in - giving you exactly what you are after.
     
    Last edited: Apr 10, 2021
  19. Eno_Fan

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

    Location:
    Izieu, France
    Indeed, I saw that comment. Unfortunately, there's no documentation of what this function is really doing, but we must remain suspicious if only because the 49 db boost in Audacity after -96 db attenuation should produce a vastly quieter file than the original, and it does not.

    Brute-force keeps coming up, and I've said that I'd be very much into seeing the results of this. You've got the file in my last post -- if you know how to do it, do so and let's see.

    That said, the conclusion that 16 bit is demonstrably not enough is robust -- there is sub-96 db information clearly visible throughout the spectrum of the percussion sample in the SPEC screenshot that cannot be captured. Whether or not that is audible to listeners is another matter, but 'perfect sound' and 'hi-res' are about capturing all that we can, not lossy, assumptive coding...
     
  20. Mal

    Mal Phorum Physicist

    My days of coding are long behind me I'm afraid - I'm enjoying backseat driving though (hope you don't mind!).

    As far as demonstrating the audible limitations of 16-bit for audio - it is well understood that this is the case. Find me anyone who believes that noise-shaping to 16-bit from longer word lengths does not offer more apparent resolution than 16-bit with flat dither.

    Any debate involves noise-shaped 16-bit and whether it is distinguishable from the longer word length digital master it was derived from.

    So, you need to devise an experiment to test that if your goal is to prove / disprove the benefits of hi-res.
     
  21. Electric Warrior

    Electric Warrior Senior Member

    Location:
    Germany
    You mentioned how you perceived the -96 dB version as silence, so can it really matter that much?

    The truncated file suffers from quantization distortion. Dithering would eliminate the distortion and increase the usable dynamic range. When I convert the original file to 16 bit with dither and crank up the volume, I can hear the cymbal ringing throughout the entire file. It's just noisier than the 24 bit version.
     
  22. Eno_Fan

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

    Location:
    Izieu, France
    Taking your three points above:

    1. Not at all, I sought inquiring input!

    2. Indeed, but I'll leave You to tell that to the CD Army that will roll-up once they read about the "...well understood" limitations of their preferred format!

    3. I rather thought that I had -- inspect the 8-bit residue after 96 db truncation of hi-res -- the only problem is turning that into practice with soft. Besides, if '2' is true then '3' follows!

    It's been interesting, but end-of-the-road I think unless someone can find a means to cleanly bit-truncate. As I suggested in an earlier reply, this is what all digital volume controls do...
     
  23. Mal

    Mal Phorum Physicist


    Although still 16-bit, noise shaped CDs (ubiquitous since the mid 90s) have increased effective dynamic range in the mid-band (where the ear is most sensitive) with the trade-off being reduced dynamic range at the low and high ends of the audio band (where the ear is less sensitive).

    This is what people claim is as good as hi-res - 16-bit audio noise shaped from a longer word length capture.

    So, that is what you'd have to test, not conventional 16-bit with flat dither which is known to be audibly compromised (hence the noise shaping).
     
    Last edited: Apr 11, 2021
  24. Jimi Floyd

    Jimi Floyd Forum Resident

    Location:
    Pisa, Italy
  25. Eno_Fan

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

    Location:
    Izieu, France
Thread Status:
Not open for further replies.

Share This Page

molar-endocrine