IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
How does a bitcrusher work?
Dirk95100
post Jun 30 2011, 08:29
Post #1





Group: Members
Posts: 33
Joined: 15-October 10
Member No.: 84639



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?
Go to the top of the page
+Quote Post
db1989
post Jun 30 2011, 12:31
Post #2





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



The input signal is quantised to a lower resolution.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Jun 30 2011, 12:42
Post #3





Group: Members
Posts: 4012
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (Dirk95100 @ Jun 30 2011, 03:29) *
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 (wikipedia)
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?

Go to the top of the page
+Quote Post
Soap
post Jun 30 2011, 13:39
Post #4





Group: Members
Posts: 1016
Joined: 19-November 06
Member No.: 37767



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.
Go to the top of the page
+Quote Post
Dirk95100
post Jun 30 2011, 13:48
Post #5





Group: Members
Posts: 33
Joined: 15-October 10
Member No.: 84639



QUOTE (Arnold B. Krueger @ Jun 30 2011, 13:42) *
QUOTE (Dirk95100 @ Jun 30 2011, 03:29) *
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 (wikipedia)
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.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Jun 30 2011, 14:28
Post #6





Group: Members
Posts: 4012
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (Dirk95100 @ Jun 30 2011, 08:48) *
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.


Go to the top of the page
+Quote Post
Rotareneg
post Jun 30 2011, 15:44
Post #7





Group: Members
Posts: 194
Joined: 18-March 05
From: Non-Euclidean
Member No.: 20701



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.

This post has been edited by Rotareneg: Jun 30 2011, 15:45
Go to the top of the page
+Quote Post
Dirk95100
post Jun 30 2011, 16:16
Post #8





Group: Members
Posts: 33
Joined: 15-October 10
Member No.: 84639



QUOTE (Arnold B. Krueger @ Jun 30 2011, 15:28) *
QUOTE (Dirk95100 @ Jun 30 2011, 08:48) *
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.

QUOTE (Rotareneg @ Jun 30 2011, 16:44) *
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. smile.gif
Go to the top of the page
+Quote Post
EliasGwinn
post Jul 7 2011, 16:20
Post #9





Group: Members
Posts: 25
Joined: 17-April 07
Member No.: 42613



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
Go to the top of the page
+Quote Post
Dirk95100
post Jul 7 2011, 16:50
Post #10





Group: Members
Posts: 33
Joined: 15-October 10
Member No.: 84639



QUOTE (EliasGwinn @ Jul 7 2011, 17:20) *
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.
Go to the top of the page
+Quote Post
Nick.C
post Jul 7 2011, 17:55
Post #11


lossyWAV Developer


Group: Developer
Posts: 1803
Joined: 11-April 07
From: Wherever here is
Member No.: 42400



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 --feedback 4| FLAC -8 ~= 320kbps
Go to the top of the page
+Quote Post
EliasGwinn
post Jul 7 2011, 19:52
Post #12





Group: Members
Posts: 25
Joined: 17-April 07
Member No.: 42613



QUOTE (Nick.C @ Jul 7 2011, 11:55) *
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
Go to the top of the page
+Quote Post
pdq
post Jul 7 2011, 20:01
Post #13





Group: Members
Posts: 3425
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (Nick.C @ Jul 7 2011, 12:55) *
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.
Go to the top of the page
+Quote Post
Nick.C
post Jul 7 2011, 21:46
Post #14


lossyWAV Developer


Group: Developer
Posts: 1803
Joined: 11-April 07
From: Wherever here is
Member No.: 42400



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]

This post has been edited by Nick.C: Jul 7 2011, 22:06


--------------------
lossyWAV -q X -a 4 --feedback 4| FLAC -8 ~= 320kbps
Go to the top of the page
+Quote Post
pdq
post Jul 7 2011, 21:53
Post #15





Group: Members
Posts: 3425
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 31st October 2014 - 06:52