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
Hi, I am using the xcorr function for identifying the similarity of the signals. the following is the code,
r1 = max(abs(xcorr(S1, shat1,'coeff')));
r2 = max(abs(xcorr(S1,shat2,'coeff')));
if r1>r2
dn=shat2;
else
dn=shat1;
end
But the problem is the signals are having 40,000 samples each. Practically I do get a lot delay. I have to send bunch of samples (like 250samples)into the xcorr for getting rid of the delay. But how do I do that? I know that I have to use a for loop, but found difficult in doing that. Can some one suggest me how do I do that.
---------- Post added at 15:12 ---------- Previous post was at 15:04 ----------
I tried something like this
for i=1:250:40000
r1 = max(abs(xcorr(S1,i), shat1,i),'coeff'))); but totally lost. Someone suggest something please....
r1 = max(abs(xcorr(S1, shat1,'coeff')));
r2 = max(abs(xcorr(S1,shat2,'coeff')));
if r1>r2
dn=shat2;
else
dn=shat1;
end
But the problem is the signals are having 40,000 samples each. Practically I do get a lot delay. I have to send bunch of samples (like 250samples)into the xcorr for getting rid of the delay. But how do I do that? I know that I have to use a for loop, but found difficult in doing that. Can some one suggest me how do I do that.
---------- Post added at 15:12 ---------- Previous post was at 15:04 ----------
I tried something like this
for i=1:250:40000
r1 = max(abs(xcorr(S1,i), shat1,i),'coeff'))); but totally lost. Someone suggest something please....