Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[SOLVED] any body can help me for getting no. of ZERO CROSSINGS of a signal

Status
Not open for further replies.

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:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top