representing the correlation function
3 views (last 30 days)
The discrete signal is disturbed by a random noise. To calculate the autocorrelation of the disturbed signal, I wrote the code:
w=randn(1,length(x)); % noise
But I'm not sure if the noise parameters are well chosen.
Jon on 7 Jan 2022
In your code the sin wave signal will have an amplitude of one, and the stadard deviation of the noise signal will also be one.
If you want a different signal to noise ratio, you can scale the noise signal, for example to have a standard deviation of 0.1 you could use
w= 0.1*randn(1,length(x)); % noise
By the way, to get your code formatted nicely and to make it easy for others to cut and paste it you can use the code button on the MATLAB answers toolbar