1 Y; A* [( O5 b5 C{:soso_e163:} & X4 N# h* S8 S
我看的资料这边,那应该是用来测量信号频率的。 9 K1 w( u9 M1 s; y* I" X2 V3q,gogo作者: zgq800712 时间: 2013-6-25 15:00
Zero Crossing Counter" ]5 k! B6 S( A, c
' K1 e0 A. g2 ^/ [5 u! f5 \! A 6 |; |( t5 B1 d& {4 |
7 E* X; p& s' u P8 HIn some DSP applications, it can be very helpful to know how many times your signal has crossed the zero-line (amplitude origin). * R$ E! n& u8 `1 v+ k$ v
5 F% G8 V% r. W$ SHow is this helpful? Well, zero-crossings can tell you very quickly if your signal is composed of high frequency content or not. Let's say your sample rate is 50kHz and over a small window of 1,000 samples there are 500 zero-crossings. That would mean that every two samples crosses the zero-line (i.e. 12.5kHz) 6 H5 J) [4 G0 S/ Q$ c% p& W1 \2 ] ?# D: g" w( V
In speech processing, the zero-crossing counts can help distinguish between voiced and un-voiced speech. Un-voiced sounds are very noise-like ('Shh' and 'Sss' for example). In addition, zero-crossings could also be used to determine if your signal has a DC offset. If you signal is 'muted' and you are not seeing alot of zero-crossings might mean that your signal is offset from the zero-line0 t) c1 \) Z1 y R, ~
# b3 f$ P# ^/ M& ?
One nice thing about the matlab code below is that it is implemented in a very DSP-friendly way. It ports very easily into C-Code and does minimizes the amount of conditional statements for faster processing time.