You are on page 1of 2

ID: 142150004

Aim: To find the zero crossings in a given speech signal.


Software: MATLAB.
Theory:

Zero-crossing rate
There is nothing particularly advanced or complicated about the zero-crossing rate (ZCR). It is a poor mans
pitch determination algorithm, working well in the absence of noise, and is designed to be very simple in terms
of computation. It works well for a noise-free and simple waveform like a sinewave, the idea being to count
how many times the waveform crosses the zero-axis in a certain time: the number of crossings per second will
equal twice the frequency. If we define sign{ } to be a function returning +1 or 0 depending upon whether the
signal is greater than zero or not, then the ZCR for the ith analysis frame, of length N can be determined as:

The 1/N provides the answer as a crossing rate: the proportion of the samples which cross the zero-axis. Most of
the time, in a system with fixed frame size, where ZCR values are compared from frame to frame, the division
is an unnecessary fixed scaling and therefore not performed.
This is illustrated in Figure where the zero crossings of a sinewave are counted over a certain analysis time. In
this case the fundamental frequency of the sinewave causes nine crossings across the plot. However in the
presence of additive noise, the wobble in the signal as it crosses the zero-axis causes several false counts. In
Figure this leads to an erroneous estimate of signal fundamental frequency in fact an estimate that would be
three times too high.

ID: 142150004

Program:
clc
close all;
clear all;
segment=audioread('arctic_a0004.wav');
zc=0;
for m=1:length(segment)-1
if segment(m)*segment(m+1) > 0
zc=zc+0;
else
zc=zc+1;
end
zcr=zc/length(segment);
end
plot(segment);
grid on
zc
Results:

You might also like