[SOLVED] Cross-correlation in matlab without using the inbuilt function?

Status
Not open for further replies.

electricalpeople

Newbie level 6
Joined
Jul 28, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,365
can someone tell how to do the cross-correlation of two speech signals(each of 40,000 samples) in the matlab without using the inbuilt function Xcorr and how do I find correlation coefficient?
Please be tolerant.Thanks in advance.
 
Last edited:

Hi

U can correlate by using a multiplier and an adder (for summing)

a sliding window function shows the peak when the two signals are matched


Regards
M Kalyan srinivas
 
Check if this is helpful for you!

Code:
clc;
clear all;
close all;

x=input('Enter the first Sequence : ');
h=input('Enter the second sequence : ');

n=length(x);
m=length(h);
k=n+m-1;
x=[x zeros(1,k-n)]';
h=wrev(h);
h=[h zeros(1,k-m)]';
for i=1:k
c(:,i)=circshift(x,i-1);
end
y=c*h;
disp('Correlation of the sequences')
disp(y');
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…