I need to model a noise whitwith a givegiven PSD. To do this, I am starting from a white gaussian noise (WGN) and feed with the wgnWGN a trasfer funtiontransfer function, which will act like a filter. Infact it'sIn fact,it's easy to prove that if you choose a PSD of the white noise equal to $1 unit^2/(Hz)$$1 {\rm unit}^2/{\rm Hz}$,then the output is $ H(f)*1$$ H(f) \times 1$. Thus $$ PSD =|H(f)|^2 $$
Gain in the transfer function actacts properly, translating the PSD up or down. The problemisproblem is with the zeros and poles. No matter how I create the tftransfer function (1st, 2nd, or majorhigher order), the PSD will be flat in the region of interest $f_{range} = [10^{-6}, 10] Hz $$f_{\rm range} = [10^{-6}, 10] {\rm Hz} $
The transfer function is $$ H = \frac{10^{-11}(s+2*10^{-3})^2}{(s+10^{-9})^2}; $$$$ H = \frac{10^{-11}(s+2 \times 10^{-3})^2}{(s+10^{-9})^2}; $$
It is easy to build in Simulink a band limited white noise whitwith PSD = 1 (choosing sample and power).
Evaluate then the output of the tfTF in matlab with this
%% PSD estimation
for i =[1e-8 1e-7 1e-6 1e-5, 1e-4, 1e-3, 1e-2 1e-1 1]
f_range = linspace(i,i*10,1000);
[pxx_white] = pwelch(white,[],[],f_range);
[pxx_color] = pwelch(color,[],[],f_range);
loglog(f_range,sqrt(pxx_white./(2*pi)),'k')
hold on
loglog(f_range,sqrt(pxx_color./(2*pi)),'r')
end
xlabel('Frequency (Hz)')
ylabel('RPSD (unit/Hz^(1/2))')
legend('white','color')
grid on
Now my question is: Am I doing something theoretically wrong? Maybe I can't reach PSD in the low frequency region due to the simulation time? I simulate for 10000 s (1e-4 Hz).
In black: white noise PSD, in red: flat the colored noise PSD, the curve is the plot of the tf.