MATLAB: How to generate white noise of particular frequency in matlab

MATLAB

Hello,
I want to generate white noise of particular frequency say 4hz . the covariance is 0.01.
how should i do this in matlab ?

Best Answer

hi,
I think you are talking about Colored noise, and bandwidth of 4hz not particular frequency,
White noise contains all the frequencies i.e flat Spectral density, so colored noise can be generated by passing the white noise through low pass filter , here is an example :
x=randn(1000,1); % Additive white Gaussian noise .
% Coefficients
a=1;
b=[1 1];
y=filter(b,a,x);
psd(x);axes=axis, title(' AWGN');
figure,psd(y);axis(axes),title(' Colored Noise');
The colored noise has approximately 0.7 Hz of bandwidth as normalized frequency . so you can adapt the parameters a and b .....