Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[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:

kalyansrinivas

Advanced Member level 4
Joined
Jul 7, 2007
Messages
100
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
1,910
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
 

Arun M

Newbie level 5
Joined
Aug 7, 2011
Messages
9
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Coimbatore, India
Activity points
1,339
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top