How to calculate the zero crossing speed of a signal?

I would like to get a zero level of intersection of the audio signal. I tried to write the code for this formula:

enter image description here

But I do not understand the full formula.

To process my code, I break the signal into blocks, I mean "blocking frames." For example, each block length is 512 (there are 512 signal samples). And let's say I have 100 blocks. Then will the zero velocity intersection return only one value for each block or not? I mean, will I have 100 values ​​for the whole signal according to the formula?

And also I do not understand what w () means. Is this the hamming that I use for window processing? And how can it calculate for nm? Most likely, it will be a negative number?

I am very confused, please help me?

+4
source share
1 answer

Forget the formula - it makes it more complicated when you try to express it that way.

The zero crossing speed is the number of times a signal changes sign over a given period of time (usually one second). That is all you need to know. Usually you are interested in the speed with which it goes from negative to positive or vice versa, and not every time the sign changes. Looking at the number of times it goes from negative to positive, you can use it as a proxy server for the signal frequency.

As for what w (nm) means, the function. This is what changes the question that your formula answers: "How many times did the signal cross zero?" "How many times did the signal cross zero in the last n samples?" Honestly, it looks like my eyes intersect, so don’t feel bad because you don’t understand this - it bothers me too. For the zero crossing speed, we choose a window function, so w will return 1 in a certain range and zero otherwise. (this is called a rectangular window). The best way to express this formula for such a window would be to forget the “window” as a general concept and limit the sigma limits (sorry, I don't know how to express formulas in SO):

Z_n (m) = sum_ {m = xn} ^ 0 | sign [x (m)] - sign [x (m-1)] |

if n = your sample rate, this will give you a zero crossing speed in Hz. It makes more sense: no more than w and no more than infinity! The source you used may have included the window in an attempt to summarize, but in this case nothing will work (as far as I know, but I don’t know everything!)

+6
source

Source: https://habr.com/ru/post/1469296/


All Articles