ΣSigmaStudio Ask AI Русский Log in

Zero Cross Rate VAD

SigmaDSP & SigmaStudio benjaminws Mar 31, 2016 00:00 5 replies Original on forum ↗
Thread Summary

Thread Summary

The user implemented a Zero Crossing Rate (ZCR) detector for non-stationary noise reduction on an ADAU1761 DSP. The initial VAD design caused stuttering due to noise passing through during the Max & Hold reset. Adding an Envelope Peak and a 1 Hz 1st order low-pass filter improved classification and smoothed the VAD's detection, enhancing performance with various noise types and SNR levels.
AI Generated Content
Subscribe
benjaminws Question
Mar 31, 2016 00:00

Hi,

I am currently working on two noise reduction algorithms. One for background noise and one for non-stationary noise. The background noise algorithm is finished. For the none stationary noise I wanted to use a VAD. The VAD block from SigmaStudio does not function properly with non-stationary noise. I created a Zero Crossing Rate(ZCR) detector to classify frames as speech or noise.

The idea is to measure the zero crossings for a frame of 20ms. If the frame contains more than 25 zero crossings it will be classified as noise and it will not be routed to the output of the DSP. What I have implemented now is shown in the figure below.

It measures the zero crossings and routes the signal with 20ms delay to the output if it is speech. The ZCR "works". Speech is routed through and noise is classified as noise, however the noise is not classified as noise when the Max & Hold is reset. During the reset the rate is 0 and the noise is routed to the output causing a stutter.

The Yellow signal is the output of the DSP. It is a noise only signal. The Blue signal is the Max & Hold. As you can see when the Max & Hold is reset the noise signal passes though for a brief period.

I want to create a buffer of 20 ms if it is possible, count the ZCR during 20ms and multiply the buffer by 1 or 0 for speech and noise respectively.

EDIT:

I changed the schematic to hold the value at the end of the frame just before the reset. Compare it to the threshold and let a 0/1 pass accordingly, use Hold blocks with a inverted timer to hold the 0/1 for 20 ms and multiply it by the delayed signal. This is on an ADAU1761. The project is attached, it works but not well. It seems some parts of the noise have the same number of ZC as the speech signal. The test signal is also attached.

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

0e91dd779f2d02a4951a027242ac775f.png
0e91dd779f2d02a4951a027242ac775f.png
0e91dd779f2d02a4951a027242ac775f.png-620x330.png
0e91dd779f2d02a4951a027242ac775f.png-620x330.png
369603df2a6c26e65b1d1a23e96cddd4.bmp
369603df2a6c26e65b1d1a23e96cddd4.bmp
ce154d430a29afc20c0f9c0b78783406.png
ce154d430a29afc20c0f9c0b78783406.png
ce154d430a29afc20c0f9c0b78783406.png-620x302.png
ce154d430a29afc20c0f9c0b78783406.png-620x302.png
benjaminws Reply
Apr 1, 2016 00:00

Adding an Envelope Peak smooths out the classification greatly. The VAD now works alright for the type of noise
of the signal.

221c422a51130f8ebc2a7238e6fcc7b4.png
221c422a51130f8ebc2a7238e6fcc7b4.png
221c422a51130f8ebc2a7238e6fcc7b4.png-620x289.png
221c422a51130f8ebc2a7238e6fcc7b4.png-620x289.png
benjaminws Reply
Apr 7, 2016 00:00

Here are some images of the results of the ZCR VAD. Below in each image are the clean speech signal, the speech + friction noise of the mic and the output of the ZCR from top to bottom respectively.

As can be seen in the image below, the VAD performs fine with medium level noises.

With higher level noises the VAD cuts of sections of speech. Maybe an adaptive ZCR threshold

could be implemented that changes with signal level.

For noises like white noise or pink noise the VAD works very good. It detects speech in signals

with a SNR of up to -20dB, of course the speech at those levels are almost inaudible.

746b9f8e6ff9982cb1aed9a86a7f4612.png
746b9f8e6ff9982cb1aed9a86a7f4612.png
746b9f8e6ff9982cb1aed9a86a7f4612.png-620x465.png
746b9f8e6ff9982cb1aed9a86a7f4612.png-620x465.png
848c0d0dbd88c8e398163c6072f41058.png
848c0d0dbd88c8e398163c6072f41058.png
848c0d0dbd88c8e398163c6072f41058.png-620x465.png
848c0d0dbd88c8e398163c6072f41058.png-620x465.png
c42ccce5d1d0dd7b013e8cd9ab595284.png
c42ccce5d1d0dd7b013e8cd9ab595284.png
c42ccce5d1d0dd7b013e8cd9ab595284.png-620x465.png
c42ccce5d1d0dd7b013e8cd9ab595284.png-620x465.png
SimonBroadley Reply
Apr 22, 2016 00:00

This is really great stuff using the Sigma Studio blocks. May I ask how you generated the speech plots? I really like how you demonstrated the last one with the red/blue color differentiation.

benjaminws Reply
Apr 22, 2016 00:00

Hi Simon,

Thanks, I have improved the algorithm a bit with a compressor etc. The plot are generated from in Matlab. I made some custom scripts to measure the SNR etc. But these are just plots of the time data. You can also make them in GNU Octave, it's like the free version of Matlab.

benjaminws Reply
Jun 8, 2016 00:00

Adding a 1 Hz 1st order low pass filter in the VAD behind the frame hold greatly improves the VAD. It's detection is a lot smoother. Also adding two threshold with hysteresis greatly improves switching between microphones. This prevents constant switching between microphones and false detection.

The image below shows the slewing of the attack and decay of the ZCR by the low pass filter.

Also because the signal is 1 Hz it can be monitored perfectly in the real time graph. Settings threshold is a lot easier now.

e706058b0513161b7ea51d855f555f5e.png
e706058b0513161b7ea51d855f555f5e.png
e706058b0513161b7ea51d855f555f5e.png-620x219.png
e706058b0513161b7ea51d855f555f5e.png-620x219.png