July 5, 2016
January 29, 2017
I hope somebody will still find my answer to be helpful, let's go.
Reducing the bit-depth means reducing the number of quantization levels in the digital signal. In extreme cases you will start to see steps in the amplitude since there are too few values to represent the level of the signal. This adds quantization noise which is just the difference between the original and the digital (quantized) signal.
If you want to implement a simple bit crusher in RaxkAFX, you need to specify a number of levels (the bit-depth) and recalculate each incoming sample so it will be shifted to the nearest level you specified beforehand.
The math behind it is quite easy. For a desired bit-depth b the formula might look like this:
y(n) = floor( x(n) * 2^(b-1) ) / (2^(b-1))
An example with 4 bits:
The input sample has a value of 0.4.
y(n) = floor( 0.4 * 2^3 ) / 2^3 = floor( 0.4 * 8 ) / 8 = floor( 3.2 ) / 8 = 3 / 8 = 0.375
The positive values will be mapped to 1 of 8 values like the negative values. This makes 16 levels.
Another example with x(n) = -1.0 and 6 bits:
y(n) = floor( -1.0 * 2^5 ) / 2^5 = floor( -1.0 * 32 ) / 32 = floor( -32 ) / 32 = -1
One might use the ceiling or rounding function instead of floor().
Most Users Ever Online: 36
Currently Browsing this Page:
Guest Posters: 1
Newest Members:hill william, NAUN_SONAR, sufy, Diane, Richard, drvenkman, venkman, Jfx, drorh, funkysteve
Moderators: W Pirkle: 237
Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 237