Google
 

Noise Cancelling DSP Algorithm using SCILAB

Noise Cancelling DSP Algorithm using SCILAB Output GraphMost engineers/geeks should already know about MATLAB. It used for numerical analysis and processing. Poor Cebuano geeks, like me, cannot afford for a legal license to use it. I am into DSP (Digital Signal Processing) and I need it to test my algorithms first before burning it into the actual hardware to shorten the debug-cycle time. So I have choosen SCILAB, a free open-source MATLAB alternative. There are other alternatives such as OCTAVE but only works in CYGWIN or LINUX. I settle for SCILAB because I like its editor and GUI viewer.

I am already proficient in MATLAB so moving to SCILAB is a breeze. SCILAB has few quirks but a quick google solved these.

So, I have developed this Noise Cancelling DSP Algorithm using SCILAB. This algorithm was used on a DSP add-on to a CSR BC3 Multimedia Bluetooth Processor for handsfree car kit application. This uses spectral subtraction to cancel the noise.

The process starts by getting 256 samples of the input signal and overlapping every 64 samples at a time. This is about 31ms for 8000 kHz sampling. The samples are then passed through a Hanning Window to smoothen the ends to get a good spectral signal before passing to the 256 point FFT (Fast Fourier Transform). The upper end (mirrored spectra) of the FFT result are discarded and the square of spectral mean are computed (real^2 + imag^2). This way the spectral power of the signal is used for processing. The frame is then passed to the VAD (Voice Activity Detector) to determine it to be a noise and speech frames.

If it is a noise frame, it will be included in the running average all of the noise frames. The averaged noise spectra will be used as noise reference to subtract input signal frame to cancel the noise.

Noise Cancelling DSP Algorithm using SCILAB, VAD performanceIf the current frame is speech, it will processed to remove the noise by subtracting it with the noise reference (Clean = Noisy - NoiseRef). The first few 10’s of milliseconds of the input signal are considered as noise (non-speech part) to have an initial noise reference. This also trains the VAD and the canceller at the same time.

The clean output signal will then be passed to a inversed FFT algorithm. Before that, the real and imaginary parts (voltage /phase angle not power) are recomputed. Then it is the mirrored conjugate is used as the upper portion of frame to complete the spectra.

The clean signal then is reconstructed using “add and overlap” technique on all the inverse FFT outputs.

This is the actual noisy test file I used to test the algorithm. And this is the clean output wav file. It is optimized and gives a decent noise canceling result.