Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
help in the autocorrelation of a feature vector

Subject: help in the autocorrelation of a feature vector

From: Regina

Date: 10 Mar, 2009 03:53:01

Message: 1 of 2

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

Subject: help in the autocorrelation of a feature vector

From: Lorenzo Guerrasio

Date: 10 Mar, 2009 09:35:02

Message: 2 of 2

"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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us