Skip to main content

Topic: How does a bitcrusher work? (Read 6814 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Dirk95100
  • [*]
How does a bitcrusher work?
Bitcrushing is an effect that is used often in modern music.
But how do they work?
To my understanding the amplitude of the digital steps are the same no matter the amount of bits used. Iaw: more bits just means you can go further down before you enter the noise.
But if you chop of bits with a crusher, the signal level stay´s the same.
What´s going on?

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
How does a bitcrusher work?
Reply #1
The input signal is quantised to a lower resolution.

How does a bitcrusher work?
Reply #2
Bitcrushing is an effect that is used often in modern music.
But how do they work?
To my understanding the amplitude of the digital steps are the same no matter the amount of bits used.


I never ever heard of a bitcrusher, but the Wikipedia article paints a pretty clear picture for me:

Quote
Bitcrusher is a digital audio effect, which produces a distortion by the reduction of the resolution or bandwidth of digital audio data. The resulting quantization noise may produce a “warmer” sound impression, or a harsh one, depending on the amount of reduction.

A number stored digitally has a resolution given as n bits, where there are 2n possible values of the number. If one reduces the number of bits used to store the number, the number of possible values of the number is decreased, and thus the resolution decreases, leading to distortion. For example, a standard CD has a resolution of 16 bits, thus there are 216 possible values for any given part of the musical waveform. If this is reduced to approx. 8 bits, distortions can be noticed, reducing the quality. These distortions add to the original overtone in such a way that the wave shape becomes angular. This can produce a “warmer” sound impression than the original waveform, especially if the wave is rounded off in certain ways. Often this is used with techno or electronic music consciously, without regard to fidelity.

An example of a sound distorted by a bitcrusher is in the introduction to the song “Chemicals” from the album "Shrink" by The Notwist. The samples used in the Roland TR-909 drum machine, for example, has a resolution of 6 bits, leading to a similar sound.

In the musical genre Hardstyle, bitcrushing has become an essential effect in many tracks.


Any questions?


  • Soap
  • [*][*][*][*][*]
How does a bitcrusher work?
Reply #3
Note the wikipedia quote is broken.  The exponential notation should have been manually fixed when pasting as plain text.  2n = 2^n, 216 = 2^16.
Creature of habit.

  • Dirk95100
  • [*]
How does a bitcrusher work?
Reply #4
Bitcrushing is an effect that is used often in modern music.
But how do they work?
To my understanding the amplitude of the digital steps are the same no matter the amount of bits used.


I never ever heard of a bitcrusher, but the Wikipedia article paints a pretty clear picture for me:

Quote
Bitcrusher is a digital audio effect, which produces a distortion by the reduction of the resolution or bandwidth of digital audio data. The resulting quantization noise may produce a “warmer” sound impression, or a harsh one, depending on the amount of reduction.

A number stored digitally has a resolution given as n bits, where there are 2n possible values of the number. If one reduces the number of bits used to store the number, the number of possible values of the number is decreased, and thus the resolution decreases, leading to distortion. For example, a standard CD has a resolution of 16 bits, thus there are 216 possible values for any given part of the musical waveform. If this is reduced to approx. 8 bits, distortions can be noticed, reducing the quality. These distortions add to the original overtone in such a way that the wave shape becomes angular. This can produce a “warmer” sound impression than the original waveform, especially if the wave is rounded off in certain ways. Often this is used with techno or electronic music consciously, without regard to fidelity.

An example of a sound distorted by a bitcrusher is in the introduction to the song “Chemicals” from the album "Shrink" by The Notwist. The samples used in the Roland TR-909 drum machine, for example, has a resolution of 6 bits, leading to a similar sound.

In the musical genre Hardstyle, bitcrushing has become an essential effect in many tracks.


Any questions?

I know the result of the process.
What I want to know is how does it get to the result?
Because if you only get rid of the lower bits, you loose level. Or am I completely missing something.

How does a bitcrusher work?
Reply #5
I know the result of the process.
What I want to know is how does it get to the result?
Because if you only get rid of the lower bits, you loose level. Or am I completely missing something.


If you set the lower level bits to zero you don't lose level nearly as badly as you make the effective size of the steps in the actual signal further apart.

For example let's say I have a signal that ramps from 0 to 255 in steps of 1. I then zero out the two low order bits in every sample, so now it ramps  from 0 to 252, but in steps of 4.

In detail, the first  5 samples are 00000000, 00000001, 00000010, 00000011, and 00000100.

After zeroing out the two LSBs, the series of 5 samples are: 00000000, 00000000, 00000000, 00000000, and 00000100.

Hope this helps.



  • Rotareneg
  • [*][*][*]
How does a bitcrusher work?
Reply #6
A perhaps more intuitive way to look at is to do an integer division of the input by some multiplier of 2 (dropping any fractions) and then multiply it by the same value afterwards. The end result is the same, the lower bits end up as zeros.
  • Last Edit: 30 June, 2011, 10:45:32 AM by Rotareneg

  • Dirk95100
  • [*]
How does a bitcrusher work?
Reply #7
I know the result of the process.
What I want to know is how does it get to the result?
Because if you only get rid of the lower bits, you loose level. Or am I completely missing something.


If you set the lower level bits to zero you don't lose level nearly as badly as you make the effective size of the steps in the actual signal further apart.

For example let's say I have a signal that ramps from 0 to 255 in steps of 1. I then zero out the two low order bits in every sample, so now it ramps  from 0 to 252, but in steps of 4.

In detail, the first  5 samples are 00000000, 00000001, 00000010, 00000011, and 00000100.

After zeroing out the two LSBs, the series of 5 samples are: 00000000, 00000000, 00000000, 00000000, and 00000100.

Hope this helps.

A perhaps more intuitive way to look at is to do an integer division of the input by some multiplier of 2 (dropping any fractions) and then multiply it by the same value afterwards. The end result is the same, the lower bits end up as zeros.

Thanks, I get it now. 

How does a bitcrusher work?
Reply #8
It should be noted that the distortion is due to bit-depth truncation without dither.  Reducing the bit-depth (aka 'word-length') won't cause distortion if dither is applied. (Also, reducing the bit-depth doesn't reduce the amplitude of the signal.  However it does require a higher level of dither (noise) to be added to avoid distortion from truncation).

The distortion resulting from reducing the bit-depth without dither is 'Quantization error'.  It occurs when the actual signal amplitude is between two quantization levels (discrete sample values), and therefore becomes encoded as a sample value that is actually above or below the actual amplitude, which is an error.

Best,
Elias
Elias Gwinn

Engineer
Benchmark Media
www.BenchmarkMedia.com

  • Dirk95100
  • [*]
How does a bitcrusher work?
Reply #9
It should be noted that the distortion is due to bit-depth truncation without dither.  Reducing the bit-depth (aka 'word-length') won't cause distortion if dither is applied. (Also, reducing the bit-depth doesn't reduce the amplitude of the signal.  However it does require a higher level of dither (noise) to be added to avoid distortion from truncation).

The distortion resulting from reducing the bit-depth without dither is 'Quantization error'.  It occurs when the actual signal amplitude is between two quantization levels (discrete sample values), and therefore becomes encoded as a sample value that is actually above or below the actual amplitude, which is an error.

Best,
Elias

Good point.

Any one know how to make/get rpdf and tpdf noise of various levels? So I can experiment with dither.

  • Nick.C
  • [*][*][*][*][*]
  • Developer
How does a bitcrusher work?
Reply #10
It could be argued that the rounding process itself dithers to a certain extent as on average 50% of the samples will be rounded up and 50% will be rounded down....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848| FLAC -5 -e -p -b 512 -P=4096 -S-

How does a bitcrusher work?
Reply #11
It could be argued that the rounding process itself dithers to a certain extent as on average 50% of the samples will be rounded up and 50% will be rounded down....


How did you come to the conclusion that 50% of samples are rounded up and 50% of samples are rounded down?
Elias Gwinn

Engineer
Benchmark Media
www.BenchmarkMedia.com

  • pdq
  • [*][*][*][*][*]
How does a bitcrusher work?
Reply #12
It could be argued that the rounding process itself dithers to a certain extent as on average 50% of the samples will be rounded up and 50% will be rounded down....

No, the quantization error is, on average, the same. All you have done is shift the data by 1/2 LSB before truncating.

  • Nick.C
  • [*][*][*][*][*]
  • Developer
How does a bitcrusher work?
Reply #13
If shortening from 24 bit to 16 bit, therefore removing LSBs 0 to 7, the state of bit 7 will dictate whether the value is rounded up or not, implying that there is a 50% chance the sample will be rounded up rather than rounded down. Difference values will range from -127 to +128.

[edit] i.e. new_sample:=round(old_sample / 256); [/edit]
  • Last Edit: 07 July, 2011, 05:06:03 PM by Nick.C
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848| FLAC -5 -e -p -b 512 -P=4096 -S-

  • pdq
  • [*][*][*][*][*]
How does a bitcrusher work?
Reply #14
If you define quantization error as the difference from some reference version of the original then you are right. However, in practical terms there will be no difference in the effect that it has. The "stair-steppiness" of the result will be the same magnitude either way, and it will be just as audible or inaudible whether you round or truncate.