# How to obtain values in physical space for a given spectrum?

My question falls under purview of turbulent flows. I want to add an initial perturbation, for which I have a given energy spectrum (say$E(k)=ak^4e^{-bk^2}$). The steps involved in getting these perturbation is as follows:

1. Choose random values for $u\in (-1,1)$
2. Fourier transform: $u(x,y,z)\rightarrow\hat{u}(k)$
3. Make $\hat{u}$ solenoidal $\hat{u}'=\hat{u}-\hat{k}.\hat{u}/k^2$
4. Scale $\hat{u}'$ with the given energy spectrum
5. Take inverse transform: $\hat{u}'(k)\rightarrow u(x,y,z)$

How to proceed when I have to give perturbations at discrete points, in which case $u(x,y,z)$ is available at discrete points $(x_i,y_j,z_k)$?