Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  -24db Precut Sound Quality on Rockboxxed iPod?
« previous next »
  • Print
Pages: 1 [2] 3 4

Author Topic: -24db Precut Sound Quality on Rockboxxed iPod?  (Read 35186 times)

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #15 on: August 07, 2007, 10:29:15 PM »
You're talking gibberish. The above signal path is *not* just 16 bit being transformed over and over. It includes the gain adjustment which removes accuracy, the exact reason why you wrote 28/32. That's 4 bits lost of accuracy. When you scale those 4 bits down to 16-bit scale, it's 2 bits loss of accuracy at that scale, is it not? But that's assuming that the 4 bits of lost accuracy is the right number, at 32-bit etc.

You're trying to imagine a scenario where audio can be transformed losslessly. If you decrease the gain in digital this is performed by multiplying the sample by a constant. Since you're decreasing, this results in a changed sample and loss of accuracy. You can't magically make the number smaller yet still keep all the bits.

For example, if you have a sample that is 1111 1111 1111 1111 and you multiply it by a smaller constant, how would you maintain all the data in that sample? You lose some, simply by definition.
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #16 on: August 07, 2007, 10:40:50 PM »
Yes actually you are right. It will lose a lot of accuracy in the process - when scaled to 16bit, which happens on Rockbox right now.

So this is the Original Rockbox:

16 -> 32 -> 28/32 -> 14/16 -> DAC -> 14bit analog signal

But so far I noticed, the iPod Rockbox only lost 2db of accuracy (instead of 4db, which I thought it be).

Well, as I mentioned above, I'm happy with -12db pre-cut listening to iPod Rockbox on -15db volume.

Until I found out that Wolfson DAC supports 96khz/24bit. Rockbox could be updated to do this:

16 -> 32 -> 28/32 -> 21/24 -> DAC -> 16bit analog signal

Edit: I finally realized that pre-cut in software EQ actually cuts away the gain/SNR/fidelity. I still hoped that the pre-cut algorithm is changed to downscale algorithm.
« Last Edit: August 07, 2007, 10:51:15 PM by Andhyka »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #17 on: August 07, 2007, 10:54:02 PM »
Again I ask you: How do you decrease a signal without losing anything? The statement makes no sense. The least you can possibly lose is the least significant bit. It's simple math.
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #18 on: August 07, 2007, 11:00:52 PM »
Umm I don't know how the algorithm works but the normalize features available on Adobe Audition seems to do exactly that. It allows records with compressed fidelity (prevalent in early 1990s) to fit into its maximum potential. I don't have it as it's very expensive but you get the idea from here:

http://blogs.magnatune.com/buckman/beier1.gif
http://blogs.magnatune.com/buckman/beier2.gif

Edit: Hmm, I guess this must be resource-intensive, and not implementable in iPod.
« Last Edit: August 07, 2007, 11:03:51 PM by Andhyka »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #19 on: August 07, 2007, 11:05:30 PM »
"Normalizing" doesn't do any such thing. Normalizing can usually be seen as increasing or decreasing the volume to a set point, usually used in an attempt to have all tracks peak at 0dB. It doesn't gain you any additional fidelity, all it does is essentially shifts/stretches where the existing range you have lies across. Are you perhaps referring to something other than a "Normalize" feature? I assure you that you cannot magically recover data that does not exist any more. The very best you can do is attempt to approximate that data in some manner.

Yes, it maximizes resolution, but it doesn't add any additional data. For example, as you said, when you go from 16-bit to 32-bit, you don't gain *anything* because you still have the same sample.

If you take something that's only using 12-bits, and you normalize it so that it's full scale 16-bi, you still have the same information (and because you're scaling to a non-integer multiple, you no longer have a lossless copy of the original).
« Last Edit: August 07, 2007, 11:12:11 PM by Llorean »
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #20 on: August 07, 2007, 11:24:57 PM »
Exactly, "normalize" does not add any clarity/fidelity to existing audio signal. It just amplifies/maximizes to its maximum limit based on signal peaks.

The antonym to "normalize" is "compress", which I thought was done at Rockbox pre-cut feature. And then, I realized from your reply that it cut away the insignificant bits of audio signal, which if done at -24db pre-cut, can make the music sounds boring/dull/lifeless.  :'(

Having a highly detailed headphone like MDR-SA5000, the difference between 0db pre-cut & -24db pre-cut is night and day. Also I believe that -24db pre-cut is performed before the audio signal enters Rockbox DSP, and is upsampled from 16bit to 32bit. So yeah, it's 4 bit short - 2^16=65536 vs. 2^12=4096 - and it's substantial.

Thanks for the feedbacks/replies. It really helps me improve my understanding on hi-fi.

Cheers.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #21 on: August 07, 2007, 11:28:47 PM »
You're still wrong. Compressing an audio signal as a method for reducing the loudness reduces its dynamic range. It is impossible not to. I don't know how I can make this more clear:

You cannot magically make a signal smaller and not lose some of it when working in digital.

If one foot were divided into 16 segments, and then you decided to shrink something down to use only 15/16 of that foot, and you have to use the same size segments still, you then only get to represent it with 15 segments, not 16 any more.

When you compress audio, you're still working with a pre-defined number of bits, so some data will be lost. It's that simple.

As well, in all honesty, a 24db cut at 16-bit vs 32-bit should result in the same number of final bits lost. You're still lowering the volume by the same amount, independent of whether the signal is represented by 16 bits or 32 bits. My example earlier was just that if you were losing 4 bits at 32-bit, those 4-bits would be equivalent to 2 at 16-bit. How much you lose should be in constant ratio, the only real advantage at 32-bit should be that as you have more resolution, is that you have to round less often for operations.
« Last Edit: August 07, 2007, 11:33:47 PM by Llorean »
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #22 on: August 07, 2007, 11:32:04 PM »
Umm yeah you are right about that. Sigh, I wish the "compress" was done after 16-bit audio signal is upsampled to 32-bit. The whole notion on pre-cut seems to indicate loss of SQ.

I just wished Rockbox would upscale 16-bit signal to 32-bit signal, then compress it back with -24db.
« Last Edit: August 07, 2007, 11:35:12 PM by Andhyka »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #23 on: August 07, 2007, 11:34:41 PM »
You cannot magically *not* lose data.

If you scale to 32-bit, then compress, then decrease to 16-bit, it will be equivalent to compressing at 16-bit. Both lose data. Since this is the only operation you're doing (compression) converting to 32-bit is pointless: You can ensure that the rounding necessary is done in the same way during the compression if you really want to. Working in 32-bit reduces the loss of accuracy when you perform multiple operations because you have more resolution.
« Last Edit: August 07, 2007, 11:37:38 PM by Llorean »
Logged

Offline Febs

  • Member
  • *
  • Posts: 2701
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #24 on: August 07, 2007, 11:38:47 PM »
Quote from: Andhyka on August 07, 2007, 11:32:04 PM
Umm yeah you are right about that. Sigh, I wish the "compress" was done after 16-bit audio signal is upsampled to 32-bit. The whole notion on pre-cut seems to indicate loss of SQ.

I just wished Rockbox would upscale 16-bit signal to 32-bit signal, then compress it back with -24db.

Could you define how you're using the word "compress" here?
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way
Please do not send me support questions via PM.

Offline safetydan

  • Developer
  • Member
  • *
  • Posts: 248
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #25 on: August 07, 2007, 11:43:09 PM »
The Rockbox DSP does things in the following order:

1. Receive PCM data from the codecs in whatever format. This is converted to an internal 32-bit fixed point format.
2. Apply a gain to the data. This gain is the combination of the replay gain and the software equalizer precut. All it is is a multiply of each sample of the PCM data.
3. Resample the data.
4. Apply crossfeed if enabled.
5. Apply the software equalizer if enabled.
6. Apply the software tone controls if enabled.
7. Apply channel processing if enabled (mono/stereo/karaoke etc).
8. Clip the samples back down to 16-bit for sending to the DAC.

Not quite sure if I have a point in all that, but I figured I'd try and write up what Rockbox actually does. May or may not be accurate but is based on reading the source.
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #26 on: August 07, 2007, 11:45:39 PM »
Ok I'll just make everything short. Compress is just anti-thesis of normalize. You compress signal from maximum SNR to reduced SNR, while you normalise signal from reduced SNR to maximum SNR.

And here's what happened during audio processing in Rockbox.

Rockbox:

SOURCE 16bit -> -24db precut (4bit) -> DSP 12bit in 32bit -> DAC 12bit in 16bit -> MUFFLED SIGNAL

What I thought originally on first post:

SOURCE 16bit -> DSP 16bit in 32bit -> -24db compress (4bit) -> DSP 16bit in 28bit/32bit -> DAC 16bit in 21bit/24bit -> CLEAN SIGNAL
(Provided there's such function called "compress" and the ADC/DAC accepts 24bit signal)
« Last Edit: August 07, 2007, 11:50:15 PM by Andhyka »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #27 on: August 07, 2007, 11:47:32 PM »
As has been clearly stated by me: lowering the gain by 24db will result in the same amount of lost data whether you do it in 32-bit or 16-bit. As was stated by Dan, the gain adjustment happens after the 32-bit conversion. You're basing the loss of 4-bits on a random statement by one person, and ignoring the mathematical implications. If you increase from 16-bit to 32-bit, the value of bits are changed entirely.

Please, if you want to make a statement as to what is happening, rather than what you mistakenly think is happening, back it up by research. His statement comes straight from the Rockbox source code, for example.
« Last Edit: August 07, 2007, 11:51:15 PM by Llorean »
Logged

Offline Andhyka

  • Member
  • *
  • Posts: 20
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #28 on: August 07, 2007, 11:53:43 PM »
I'm not a developer and audio expert in this regard, and I don't know what happened in the inner workings of Rockbox. I'm just trying to figure out everything without good background on those areas (so as to use my Rockbox'ed iPod to maximum potential).  >:(

If you have any recommended settings I can directly use to do so. Let me know.

Peace.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: -24db Precut Sound Quality on Rockboxxed iPod?
« Reply #29 on: August 07, 2007, 11:56:15 PM »
It's basic math: If something removes 4 bits at 16-bit, it removes 8 bits at 32-bit. If it also only removed 4 bits at 32-bit, then why couldn't we do it simply by removing 2 bits at 16-bit, and never do the conversion? It's all math, and it's all determinate. If you look at it that way, it's absolutely clear that the same determinate mathematical operation cannot have two different results when applied to the same data, now can it?
Logged

  • Print
Pages: 1 [2] 3 4
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  -24db Precut Sound Quality on Rockboxxed iPod?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.085 seconds with 15 queries.