[SOLVED] Noise Colouring Filters

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

[SOLVED] Noise Colouring Filters

Post by CrocoDuck »

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.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Noise Colouring Filters

Post by CrocoDuck »

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

Post Reply