Difference between revisions of "Creating Bluish Noise With Minimal Compute"

From 8BitDev.org - Atari 7800 Development Wiki
Jump to: navigation, search
Line 3: Line 3:
 
== The Algorithm ==
 
== The Algorithm ==
  
Blue noise is typically created by generating random values, and massaging them in various ways to not be as clumpy. This isn't a great approach for older platforms that don't have a lot of compute or ram.
+
Blue noise is typically created by generating random values, and massaging them in various ways to not be as clumpy. This isn't a great approach for older platforms that don't have a lot of compute horsepower or ram.
  
 
An alternative approach is to use an exponentially decaying average, to ensure the next new number isn't clumped together with recently returned numbers...
 
An alternative approach is to use an exponentially decaying average, to ensure the next new number isn't clumped together with recently returned numbers...
Line 15: Line 15:
 
The algorithm creates the expected +3 dB per octave power increase, and works equally well with LFSR noise sources.
 
The algorithm creates the expected +3 dB per octave power increase, and works equally well with LFSR noise sources.
  
Adding more random values into the comparison will purify the blue noise, at the expense of addition compute time.
+
Adding more random values into the comparison will purify the blue noise, at the expense of adding more compute time.
  
 +
== Spectrum Analysis ==
 +
<gallery widths=800px>
 +
File:Spectrum_bbblue.png|Spectrum Analysis of a 16-bit LFSR with bluish processing.
 +
File:Spectrum_bb16.png|Spectrum Analysis of a 16-bit LFSR without bluish processing.
 +
</gallery>
 
== Authorship ==
 
== Authorship ==
  
 
The novel Bluish Noise technique described here was created by Mike Saarna.
 
The novel Bluish Noise technique described here was created by Mike Saarna.

Revision as of 03:28, 23 May 2024

Blue noise is a type of noise with a power density that increases with frequency, giving it a high-pitched, hissy sound. Visually, it manifests as a pattern with minimal low-frequency components and a relatively even distribution of points, and is frequently used for dithering. Blue noise is often used for its aesthetically pleasing randomness, since numbers don't clump together as they would with truly random (white noise) sources.

The Algorithm

Blue noise is typically created by generating random values, and massaging them in various ways to not be as clumpy. This isn't a great approach for older platforms that don't have a lot of compute horsepower or ram.

An alternative approach is to use an exponentially decaying average, to ensure the next new number isn't clumped together with recently returned numbers...

A=RAND
B=RAND
if ABS(B-C) > ABS(A-C) then A=B
C=(C+A)/2 ; exponentially decaying running average
; "A" is holding your next bluish noise value

The algorithm creates the expected +3 dB per octave power increase, and works equally well with LFSR noise sources.

Adding more random values into the comparison will purify the blue noise, at the expense of adding more compute time.

Spectrum Analysis

Authorship

The novel Bluish Noise technique described here was created by Mike Saarna.