What does a "noise shaper" and a "modulator" do on HQPlayer?
I have seen some people here say that with a Holo Spring 3, there is no need to use DSD in HQPlayer. Would you agree with that?
Technically a modulator and noise shaper are sort of the same thing, though modulator specifically implies modulating to a lower bit depth.
Basically, when you convert a higher bit depth piece of info to a lower bit depth piece of info, you encounter a 'quantization error'. Simple example of this:
- You have a device with a maximum output of 3V
- You need to output exactly 2V
- This can be accurately represented by a 2-bit system, because two bits can be '11' (100%/3V), '10' (66%/2V), '01' (33%/1V) or '00' (0%/0V). So you just choose '10' and you're good.
- If you now wanted to get this output with a 1-bit system, you can't do it accurately. A 1-bit system can only be '1' (100%/3V) or '0' (0%/0V). And so picking the closest value of '1' (3V), you now have a quantization error of 1V, the difference between the value you intended and the actual value.
This can be shown visually too. Here for example is an image on the far left, represented with 8-bit accuracy, meaning there are 255 different possible shades from black/white that can be used to represent each pixel.
If you now wanted to represent each pixel with just 1-bit, meaning ONLY pure black or pure white, you can do so by just throwing away the bottom 7 bits and keeping only the top bit '1' (black) or '0' (white). But you've thrown away all the finer detail information about the particular shade and this leaves a fairly inaccurate result due to what is called truncation distortion.
We can address this by dithering, which is the process of intentionally adding some random noise to prevent any strong signal-correlated truncation distortion errors. This can get us closer to a more perceptually ideal result, but it's still not perfect.
We can take things a step further by applying dithering in a more advanced way, called noise-shaping. This means that rather than noise being added in a more random fashion and evenly distributed, a feedback loop system is employed to correct remaining noise/quantization error and provide more dynamic range within the area we want or the area of perceptual relevance, and shape the quantization error out to areas where it's not as much of an issue.
In audio, this means that the noise shaper is designed in a way which provides higher dynamic range in the audible band itself, and shapes the quantization errors out to higher frequencies, where they can just be filtered out with an analog filter.
This image shows a 1khz signal, represented by 768khz 8-bit PCM. No dithering was applied, and so we can see unwanted extra content, truncation distortion.
Now if we apply some standard TDPF dither, this adds a small amount of random noise, but in doing so removes the truncation distortion and actually results in better effective dynamic range:
We can then try with a noise shaper, HQPlayer's LNS15 noise shaper in this instance, which prioritises dynamic range in the audible band, and shapes the noise out to higher frequencies and gives us even better dynamic range up to about 100khz, and the higher noise above 100khz can just be filtered out by the DACs analog filter:
Noise shaping can be applied when upsampling just in PCM as shown above, because the new samples generated as part of the upsampling are only as accurate as the bit-depth of the output allows. They can't perfectly represent the ideal real value, so quantization error is still a concern even though you're not actually reducing bit depth.
But when doing upsampling + modulation, such as converting 16 bit PCM info to higher rate, 1-bit DSD info, you have enormous quantization error, and thus there's a lot of work for the modulator to do to try to get a high dynamic range output in the area you want.
SUPER TLDR:
Even if something can only be 'on' at 100% or 'off' at 0%, you can still get an output of say 80% by turning it off and on a hundred thousand times rapidly, with it being 'on' about 80% of the time, and then filtering out the excess high-frequency noise.