Forums

Mesaure Zero Crossing Rate for audio descrimination

Started by Carmen April 4, 2006
Can anyone point me to a general solution for measuring the zero
crossing rate of an audio signal if I have the individual samples??

Thanks
Carmen Branje

Carmen wrote:
> Can anyone point me to a general solution for measuring the zero > crossing rate of an audio signal if I have the individual samples??
Zero-crossing rate can mean either a signal's slope at zero crossing instants, or the repetition rate in time at which zero crossings occur. Which meaning do you have in mind? Noise interferes with either measurement. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Carmen wrote:
> Can anyone point me to a general solution for measuring the zero > crossing rate of an audio signal if I have the individual samples?? > > Thanks > Carmen Branje
How about counting the number of zero crossings in one second?
> >Carmen wrote: >> Can anyone point me to a general solution for measuring the zero >> crossing rate of an audio signal if I have the individual samples?? >> >> Thanks >> Carmen Branje > >How about counting the number of zero crossings in one second? > >
My algorithm goes something like this function f = ZCR(frame_no,input_signal) % This function simply reports the number of times % that the input vector crosses the zero boundary accumulator=0; %initialise accumulator to zero for z=2:1:Samples_per_frame buffer=z; buffer=buffer+(Samples_per_frame*(frame_no-1)); accumulator= accumulator+ abs((sign(input_signal(buffer))-sign (input_signal(buffer-1)))); end f=0.5*accumulator; return ; Basically, it will calculate the zero crossing rate of a particular frame of speech,input signal is the whole length of speech. Sorry if my programme is not very well written, i'm still quite new to DSP. Hope its able to help. :)
So how to do used the results to descriminate speech. What are your
theshold values for speech and music respectively??

Carmen

>So how to do used the results to descriminate speech. What are your >theshold values for speech and music respectively?? > >Carmen > >
Well, for me, i'm doing something on speech detection so for example, i'm assuming the 1st 100ms(10 frames) to be just noise and compute IZC=mean(zero_crossing_rate(1:10)); stddev=std(zero_crossing_rate(1:10)); IF=25; IZCT=min(IF,IZC+2*stddev); If the ZCR of the frame in question is more than IZCT i will consider it as speech. I'm implementing it with an energy detection algorithm. I guess you have to consider your context and make some changes accordingly. ;)
I'm still a little unclear

so IZC=mean(zero_crossing_rate(1:10));    means

take the average zero crossing rate for 10 frames

and stddev=std(zero_crossing_rate(1:10)); mean

take the standard deviation of the zero crossing rate

Why do you chose a minimum between 25 and the average + 2 times the
standard deviation.

In general, should speech have more zero crossings than music . . how
do that work exactly, what properties are we trying to measure?


Thanks in advance
Carmen Branje

Right, but how do I use that number to determine speech or music?

>I'm still a little unclear > >so IZC=mean(zero_crossing_rate(1:10)); means > >take the average zero crossing rate for 10 frames
yes
> >and stddev=std(zero_crossing_rate(1:10)); mean > >take the standard deviation of the zero crossing rate >
yes
>Why do you chose a minimum between 25 and the average + 2 times the >standard deviation.
Its a formulated equation. I guess someone did some studies on it. :)
> >In general, should speech have more zero crossings than music . . how >do that work exactly, what properties are we trying to measure? > >
As for this,you will have to check it out as my knowledge is only to that of speech.Maybe you can run a search on google and find out the zero crossing rate of music and speech? Lets say if the zero crossing rate of speech is 20 and music is 50, by comparing the current frame zero crossing rate, you can have a better idea what is it. :) That's just my opinion but i'm no expert in dsp.if you really want some professional help, you can try asking those who are more proficient. :)
>Thanks in advance >Carmen Branje > >