[SOLVED] Noise Colouring Filters

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
CrocoDuck
Establlshed Member
Posts: 895
Joined: Sat May 05, 2012 6:12 pm
Contact:

[SOLVED] Noise Colouring Filters

Postby CrocoDuck » Mon May 09, 2016 8:02 pm

Hi there!

I am writing a simple Julia program to generate random noise of various colours. I was thinking to start from white noise and then use colouring filters. Anybody here can point me to some source discussing high accuracy colouring filters?
Last edited by CrocoDuck on Sat May 14, 2016 3:12 pm, edited 1 time in total.
Check my Linux audio experiments on my SoundCloud.
Browse my AUR packages.
Fancying a swim in the pond?

User avatar
CrocoDuck
Establlshed Member
Posts: 895
Joined: Sat May 05, 2012 6:12 pm
Contact:

Re: Noise Colouring Filters

Postby CrocoDuck » Sat May 14, 2016 3:11 pm

Hey there!

I had a look at the source code of few generators around and most of them just scale the Fourier transform of random data. I decided to go for a similar way, but I instead define a whole complex frequency response with the required magnitude and linear phase. I apply then this frequency response to the Fourier transformed noise. The coloured noise is then the inverse transform. In Julia code sounds like this:

Code: Select all

# For example, pink noise

x = randn(s)             # Random Gaussian Noise

X = rfft(x)                 # Fourier Transform (use Hermitian Symmetry)

f = 1:(fld(s, 2) + 1)          # Frequency axis (unormalized)

H = sqrt(1 ./ f) .* exp(f * im)   # Colouring filter Frequency Response

X = X .* H                     # Frequency Domain Convolution

x = irfft(X, s)             # Coloured noise

Check my Linux audio experiments on my SoundCloud.
Browse my AUR packages.
Fancying a swim in the pond?


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 8 guests