How can I study Autocorrelation function of common inputs?
6 views (last 30 days)
Teodoro Coluccio on 28 Jun 2022
I'm trying to study the autocorrelation function for some basic signals, such as rectangularPulse and triangularPulse, and to do that I found the xcorr () function. The problem is that the function wants 2 vectors in input, so I'm trying to convert the function to vectors, but mine can be a non linear function...
Also I don't even know if this is the right way...
Everything I'm trying I found here https://en.mathworks.com/help/signal/correlation-and-convolution.html.
Balaji Udayagiri on 5 Jul 2022
As per my understanding, you want to know how to perform autocorrelation for non-linear functions.
You can use the xcorr() function to do the same.
Here is an example code using a sine function to do the same:
fs = 1.0e4;
t = 0:1/fs:0.005;
signal = sin(2*pi*1000*t)';
[c,lags] = xcorr(signal);
You can replace the sin function of any linear or non-linear function of your choice.
More Answers (1)
Jonas on 30 Jun 2022
Edited: Jonas on 30 Jun 2022
you can simply generate your own vectors in matlab and do some studying
rectPulse = [zeros(1,10) ones(1,15) zeros(1,10)];