# How to generate random samples of Gaussian distribution directly in the frequency domain?

One can easily draw (pseudo-)random samples from a normal (Gaussian) distribution by using, say, NumPy:

import numpy as np
mu, sigma = 0, 0.1 # mean and standard deviation
s = np.random.normal(mu, sigma, 1000)


Now, consider the Fast Fourier transform of s:

from scipy.fftpack import fft
sHat = fft(s)


Can we generate sHat directly without the Fourier-transform of s?

I have recently tried to discuss a practical implementation of such thought herein.

If a signal $x$ is real-valued, then its DFT $X$ will exhibit complex-conjugate symmetry: $$X[k] = X^*[N-k].$$
So you can generate $N$ Gaussian pseudo-random noise samples, $g[n]$, and place them in the frequency domain noise vector, $\epsilon$ as: $$\epsilon[k] = g[k] + j g[k+N/2]$$ for $k \in \{ 0, 1, \ldots, N/2-1\}$ and $$\epsilon[k] = \epsilon^*[N-k]$$ for $k \in \{ N/2, N/2+1, \ldots, N-1 \}$ where $\epsilon^*$ is the complex conjugate of $\epsilon$ and is equal to $\Re[{\epsilon}] - \Im[{\epsilon}]$ (i.e. the same real part and the negative of the imaginary part).
• Peter: As you probably know, I'm a beginner. When you have a chance, could you explain why that's necessary and what $\epsilon^{*}$ is. Thanks. – mark leeds Feb 6 '18 at 16:58