FWGN model implementation vs explaination (textbook pages attached) I came across the FWGN model for multipath channel simulation in the book: "MIMO-OFDM Wireless Comuunications with MATLAB"

Here is an explanation about Clarke/Gans model:


Some code to generate a Chanel using this model is also in the book:
here is some of it:

function [h,Nfft,Nifft,doppler_coeff]=FWGN_model(fm,fs,N)
% FWGN (Clarke/Gan) Model
% Input: fm= Maximum Doppler frquency
% fs= Sampling frequency, N = Number of samples
% Output: h = Complex fading channel
Nfft = 2^max(3,nextpow2(2*fm/fs*N)); % Nfft=2^n
Nifft = ceil(Nfft*fs/(2*fm));
% Generate the independent complex Gaussian random process
GI = randn(1,Nfft); GQ = randn(1,Nfft);
% Take FFT of real signal in order to make hermitian symmetric
CGI = fft(GI); CGQ = fft(GQ);
% Nfft sample Doppler spectrum generation
doppler_coeff = Doppler_spectrum(fm,Nfft);
% Do the filtering of the Gaussian random variables here
f_CGI = CGI.*sqrt(doppler_coeff); f_CGQ = CGQ.*sqrt(doppler_coeff);  % &lt;--- Why sqrt ?
% Adjust sample size to take IFFT by (Nifft-Nfft) sample zero-padding
Filtered_CGI=[f_CGI(1:Nfft/2) zeros(1,Nifft-Nfft) f_CGI(Nfft/2+1:Nfft)];
Filtered_CGQ=[f_CGQ(1:Nfft/2) zeros(1,Nifft-Nfft) f_CGQ(Nfft/2+1:Nfft)];
hI = ifft(Filtered_CGI); hQ= ifft(Filtered_CGQ);
% Take the magnitude squared of the I and Q components and add them
rayEnvelope = sqrt(abs(hI).^2 + abs(hQ).^2);
% Compute the root mean squared value and normalize the envelope
rayRMS = sqrt(mean(rayEnvelope(1:N).*rayEnvelope(1:N)));
h = complex(real(hI(1:N)),-real(hQ(1:N)))/rayRMS;


I have noticed that this implementation multiplies the noise with a square root of the filter response in the frequency domain, why did the writer use the square root of the doppler spectrum ?

A similar representation is also present here.

EDIT:
Another thing, the text doesn't mention the $-\pi/2$ phase shift nor does it implement it in the code. Why is that ?
Is that just multiplication by -j ? If so, why negative ?
I assume that the function Doppler_spectrum computes the desired power spectrum of the noise. Since the power spectrum of a filtered noise process gets multiplied with the squared magnitude of the filter's frequency response, the filter's frequency response needs to be square root of the desired power spectrum (assuming white noise at the filter's input).

In formulas, if a random process $X(t)$ with power spectrum $S_X(\omega)$ is filtered by an LTI system with frequency response $H(\omega)$, the power spectrum $S_Y(\omega)$ of the output signal $Y(t)$ is given by

$$S_Y(\omega)=S_X(\omega)|H(\omega)|^2$$