Sep 6, 2010 #1 H harithota20 Junior Member level 2 Joined Jul 22, 2010 Messages 20 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Location kolkata Activity points 1,397 how to find the no. of zero crossings of a random signal in matlab. i am using this code, but i am not getting the exact answer, function zc=zcr(sig,N) clear all; fid=fopen('C:\Documents and Settings\Measurement lab\Desktop\imf1.txt'); data=fread(fid,1000,'bit4'); plot(data(1:100)); grid on; sig = data; thresh = 0; N = length(sig); zc = (sig >= thresh) - (sig < thresh); count = sum((zc(1:N-1) - zc(2:N)) ~= 0); Last edited: Sep 8, 2010
how to find the no. of zero crossings of a random signal in matlab. i am using this code, but i am not getting the exact answer, function zc=zcr(sig,N) clear all; fid=fopen('C:\Documents and Settings\Measurement lab\Desktop\imf1.txt'); data=fread(fid,1000,'bit4'); plot(data(1:100)); grid on; sig = data; thresh = 0; N = length(sig); zc = (sig >= thresh) - (sig < thresh); count = sum((zc(1:N-1) - zc(2:N)) ~= 0);