Page 1 of 1

[SOLVED] Noise Colouring Filters

Posted: Mon May 09, 2016 8:02 pm
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?

Re: Noise Colouring Filters

Posted: Sat May 14, 2016 3:11 pm
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