Problem using xcorr

I am running the following code to find out the number of times a portion of the original signal is repeated in the audio.
[disco,f]=wavread('C:\Users\V\Downloads\gun.wav'); disco=disco(:,1); kisi=disco(100000:120000); s1=size(disco); a=0; s2=size(kisi); w=zeros(s2); for i=1:s1-s2+1; w=zeros(s2); w=disco(i:i+s2-1); c = xcorr(w,kisi,'biased'); if max(c)> 0.6 a=a+1; end end a
When I run it, it gets hung. It gives me the following error when I ctrl+C
??? Operation terminated by user during ==> xcorr>vectorXcorr at 153
In ==> xcorr at 54 [c,M,N] = vectorXcorr(x,autoFlag,varargin{:});
In ==> shit at 17 c = xcorr(w,kisi,'biased');
Can anyone help?

Answers (1)

Well here's your problem:
In ==> shit at 17
You have shit in your program. That's never good.

2 Comments

:) i know
Happens to me too. Frequently I have imshit(), but changing it to imhist() always gives me the histogram I was wanting.

Sign in to comment.

Asked:

on 17 Dec 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!