|
"Regina " <velasquezregina@rocketmail.com> wrote in message <gp4o6t$seu$1@fred.mathworks.com>...
> i have a feature vector(contains all the value of the aspect ratio computed in my bounding box), a 1X56 double array
>
> i need to get the autocorrelation of this vector.
>
> where : feature = [feature temp];
> FeatureLength = length(feature); %number of frames
>
> for i=1:length(feature)
> R = (1/(FeatureLength+1-i)) * (sum((feature(:,i))*(feature(:,i-1))));
> end
>
> in this formula i need to get the value of the current frame and the frame before it.
> however if you start in the first frame there will be an error.
> how can i make a for loop and a if else statement that would still get the autocorrelation of all the frames starting from frame 1.
>
> hope someone will help me with this
Can't you use xcorr? Or,if you don't have the signal processing tool box, conv?
Cheers
|