Implementation of LMS and VSLMS algorithms for ...

6 downloads 1616 Views 1MB Size Report
The real-time experimental setup using DSP processor as shown in. Fig. 3 has one DSK (DSP Starter Kit), one Lenovo laptop with. CCSv3.1, one HP laptop with ...
ISSN: 2278 – 909X International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4, Issue 11, November 2015

Implementation of LMS and VSLMS algorithms for Speech Enhancement using TMS320C6713 DSP Processor Deepika Pandey, Akshita Bhatnagar, Aniket Kumar, Pankaj Goel, Mahesh Chandra 

Abstract— This paper describes a speech enhancement system based on TMS320C6713 digital signal processor (DSP) for real-time application. As the technology advances, we require more complex systems for sophisticated algorithms involving digital signal processing (DSP) techniques. Therefore, the hardware implementation of algorithms using DSP has gained much more attention during past few years. One of the most important applications of DSP is speech enhancement which focuses on eliminating the background noise from the speech signal. In this paper we will focus on enhancement of speech audio signal from noise and will compare Least Mean-Square (LMS) and Variable Step-Size LMS (VSLMS) algorithms using DSP processor with code composer studio (CCS) v3.1. As an input we have used clean Hindi audio speech signal and uniform noise signal for examining the SNR. Index Terms— Adaptive Noise Cancellation (ANC), Least Mean Squared (LMS), Signal-to-Noise Ratio (SNR), Variable Step-Size LMS (VSLMS).

I. INTRODUCTION Speech signals in the real world scenarios are often corrupted by various types of degradations. Degraded speech here means poor perceptual quality and intelligibility. Poor perceptual quality of speech will lead to listener fatigue and poor intelligibility will lead to degraded performance in tasks like speech and speaker recognition. The objective of this paper is noise minimization and quality improvement of the signal through hardware implementation of adaptive noise cancellation. DSP processors are used for speech enhancement and are primarily concerned with real-time signal processing. Real-time signal processing means that the processor will keep pace with some external event [2]. Deepika Pandey, ECE Department, IMS Engineering College, Ghaziabad, India. Akshita Bhatnagar, ECE Department, IMS Engineering College, Ghaziabad, India. Aniket Kumar, ECE Department, IMS Engineering College, Ghaziabad, India. Pankaj Goel, ECE Department, IMS Engineering College, Ghaziabad, India. Mahesh Chandra, ECE Department, BIT Mesra, Ranchi, India.

Real-world signals which are analog in nature need to be processed so that the information contained in them can be displayed, analyzed or converted to other useful form [9].This operation is performed by Digital Signal Processing (DSP) system. The DSK board is of an approximate size of 5x8 inches. TMS320C6713 is floating-point digital signal processor having 16-bit stereo codec TLV320AIC23 (AIC23) for analog input and output [6]. The DSK board includes 256 kB (kilobytes) of flash memory and 16 MB of synchronous dynamic random access memory [6]. There are also four connectors on the board for input and output connections: MIC IN is for microphone input, LINE IN is for line input, LINE OUT is for line output, and through HEADPHONE headphones can be connected to play the output (usually multiplexed with line out). In this paper, the comparative performance of LMS and VSLMS adaptive algorithms are presented when implemented on TMS320C6713 DSP kit and the obtained results were then analyzed using Goldwave software. II. ADAPTIVE FILTERS A filter is a device that can map its input signal to an output signal in order to extract the desired information contained in the signal. Adaptive filter is a filter that is capable of tracking the variations in the statistical characteristics of input data such as mean and correlation functions and capable of self-adjusting its parameters. Adaptive filters are used for most of applications today because they have the ability to self-modify its frequency response and also to adapt the response according to the changes in the input signal characteristics.

Fig. 1 General Adaptive Filter Configuration

Adaptive filters are needed where the signal or system involved is fluctuating, or statistics involved and parameters of random signal are changing from time to time. The aim of adaptive filtering systems is to minimize the noise portion in order to obtain the uncorrupted desired signal. Here, a reference 2659

All Rights Reserved © 2015 IJARECE

ISSN: 2278 – 909X International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4, Issue 11, November 2015 of the noise signal which is called as reference signal x(n) is given to the filter. We need to design a filter so that output y(n) becomes close estimate of d(n). For this the adaptive filter performs the task of prediction which involves filtering of the reference signal x(n). The noise which is present in the reference signal is then subtracted from the primary signal which will provide an error signal e(n). Error signal e(n) will be feedback to adaptive algorithm and filter weights are adjusted so that y(n) becomes better estimate of d(n). Several Adaptive Algorithms can be used such as Least Mean Square (LMS), Recursive Least Mean Square (RLS), Normalized Least Mean Square (NLMS), Variable Step-Size LMS (VSLMS), etc. A. Adaptive Noise Cancellation Adaptive noise cancellation (ANC) shown in Fig.2 is performed by subtracting predicted noise from a received signal, and continues the process of updating filter weights in order to get an improved signal-to-noise ratio. The ANC system is composed of two types of inputs, one is a primary input also called as source signal s(n) and other is reference input or noise input x(n). The primary signal gets corrupted by a noise x 1(n) which is usually correlated with noise signal x(n). The reference signal can vary in amplitude, phase or time [1] as it is not correlated with noise portion of primary signal. We get the desired signal d(n) after the addition of primary signal s(n) to the correlated noise signal x1(n). The reference signal x(n) will be given to adaptive filter such that its output y(n) can be subtracted from desired signal d(n) to yield error signal e(n).

filter are updated with each iteration according to the following recursive relation [3, 6]: 𝑤𝑘 (𝑛 + 1) = 𝑤𝑘 (𝑛) + 2 𝛽 𝑥 (𝑛 − 𝑘)𝑒 (𝑛)

(1)

where, k =0,1,…., N-1, x(n) represents the input vector or time delayed input samples, wk(n) is the N weights or coefficients of the adaptive FIR filter tap at specific time n and β is called as the step size. The value of β will affect the performance of the LMS algorithm, if β value is too small, in this case the adaptive filter will take more time to converge to its optimal solution and if β value is too large then in that case the adaptive filter becomes quite unstable and its output will diverge from optimal solution [4]. 2.

VSLMS algorithm

The VSLMS algorithm was introduced in 1986 [8]. LMS algorithm has fixed step size value for every tap weight in each iteration [5]. In VSLMS algorithm the step size is improved after every sample of data, as weight improves in LMS algorithm. y(n)=wH(n).x(n)

(2)

e(n) = d(n) – y(n)

(3)

ŵ(n+ 1) = ŵ(n) + µ.x(n).e(n)

(4)

VS LMS algorithm is obtained by combining LMS algorithms with different step sizes. Larger step-size will provide faster convergence whereas smaller step-size will reduce the misadjustment factor. C. Experimental Setup

Fig. 2 Adaptive Noise Cancellation System

The output of the summer block is feedback to adaptive filter in order to update the filter coefficients. The above process will run recursively till we get the signal which is free of noise (no or reduced noise component) which is supposed to be exactly the same or similar to primary signal s(n). B. Adaptive Algorithms The two classes of adaptive algorithms which we will use in this paper are: Least Mean-Square (LMS) and Variable Step-size LMS (VSLMS). 1.

LMS algorithm

The LMS algorithm was devised by Widrow and Hoff in 1959 [1]. It is widely used because of its simplicity and it is a stochastic gradient-based algorithm. This algorithm belongs to the family of stochastic gradient algorithms involving filtering and adaptive process. The filter tap weights for the adaptive

Fig. 3 Real-time experimental setup using DSP processor

The DSP development software i.e. Code Compose Studio can accept either C or assembly code to generate output (.out) file, which can be load on DSP chip. In this case, C programming is used corresponding to the desired problem. The real-time experimental setup using DSP processor as shown in Fig. 3 has one DSK (DSP Starter Kit), one Lenovo laptop with CCSv3.1, one HP laptop with Goldwave software which is used

2660 All Rights Reserved © 2015 IJARECE

ISSN: 2278 – 909X International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4, Issue 11, November 2015 to record the output and one Headphone to play the output using HEADPHONE OUT port of DSK.

III. RESULTS We have implemented the LMS and VSLMS algorithms in C code using DSP kit (TMS320C6713) and observed the following waveforms in Goldwave: Noise, dplusn (desired signal+noise), error (e(n)), yn (output of adaptive filter). We have given uniform noise as an interference signal which was added to clean speech signal (yaha se lagbhag paanch mile dakshin pashchim me katghar gaon hai). Both noise signal and clean audio signal are played repeatedly through window media player and given to LINE IN port of DSK board using 3.5mm jack cable whose other side is connected to PC. The output is played through headphone connected at HEADPHONE OUT port of DSK board. A. For LMS Algorithm For the applied input at LINE IN port of the DSK (DSP Starter Kit) board, following output has been obtained which are shown below:

Fig. 5 Noisy signal waveform for LMS

Fig. 5 is showing noisy signal waveform i.e. clean Hindi audio signal plus noise signal observed on Goldwave for the LMS algorithm.

Table I. SNR calculations for LMS algorithm S.No.

INPUT SNR (dB)

OUTPUT SNR (dB)

1

-15

15.35

2

-10

25.75

3

-5

27.43

4

0

32.09

.

Fig. 6 Estimated Signal (Output) Waveform for LMS

The above Fig.6 shows the output waveform of estimated signal e(n) for the applied clean Hindi audio signal and uniform noise signal for LMS algorithm. Here it has been clearly shown that the noise get cancelled after applying the LMS algorithm. B. For VSLMS Algorithm .Fig. 4 Bar chart representation of input – output SNRs for LMS algorithm

For the VSLMS algorithm, following observations were made using DSP6713 processor for the applied inputs. TABLE I shows the values of input SNRs and corresponding output SNRs calculated for LMS algorithm. The Bar chart shown in Fig.4 is showing relationship between Input SNR and output SNR.

2661 All Rights Reserved © 2015 IJARECE

ISSN: 2278 – 909X International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4, Issue 11, November 2015 Table II. SNR calculations for VSLMS S.No.

INPUT SNR (dB)

OUTPUT SNR (dB)

1

-15

22.45

2

-10

24.57

3

-5

25.57

4

0

24.52

Fig. 9 Estimated Signal (Output) Waveform for VSLMS

Fig. 7 Bar chart representation of input – output SNRs for VSLMS algorithm

Fig. 9 shows waveform for estimated signal e(n) for the applied clean Hindi audio signal and uniform noise signal for VSLMS algorithm. Here it has been clearly shown that the noise get minimized

TABLE II shows the values of input SNRs and corresponding output SNRs calculated for VSLMS algorithm. The bar chart shown in Fig.7 is showing relationship between Input SNR and output SNR.

Fig. 10 Comparative Performance of LMS and VSLMS

IV. CONCLUSION

Fig. 8 Noisy signal Waveform for VSLMS

Fig. 8 is showing noisy signal waveform i.e. clean Hindi audio signal plus noise signal observed on Goldwave for the VSLMS algorithm.

In this paper the behavior of LMS and VSLMS algorithms was analyzed for Hindi clean audio signal & uniform noise as an interference signal. Experimentally It has been observed that for a fixed filter length, at low input SNR values, say -15 dB, VSLMS algorithm performs better than LMS algorithm whereas, at higher input SNR values, say 0 dB, LMS algorithm performs better than VSLMS algorithm.

.

2662 All Rights Reserved © 2015 IJARECE

ISSN: 2278 – 909X International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4, Issue 11, November 2015 REFERENCES [1] Vijay Kumar Gupta, Mahesh Chandra, and S.N. Sharan, “Real Time Implementation Of Adaptive Noise Canceller,” International Conference On Systemics, Cybernetics and Informatics, 2012, 24-28. [2] Muhammad Amir Shafiq, Saqib Ejaz and Nisar Ahmed, “Hardware Implementation of Adaptive Noise Cancellation over DSP Kit TMS320C6713,” International Journal of Signal Processing, vol. 7, Issue 1 ,2013, 75-86. [3] Rajkumar Thennua and S.K.Aggarwal, “Hardware Implementation of Adaptive Algorithms for Noise Cancellation,” International Conference on Network Communication and Computer,553-557,2011. [4] Rajkumar Thennua and S.K.Aggarwal, "Hardware Implementation of NLMS Algorithm for Adaptive Noise Cancellation." National Conference on Electronics and Communication (NCEC-2010). 2010. [5] Sulekha saxena, V.K Gupta, Mahesh Chandra, and Pankaj Goel, “A Family of Adaptive Filter Algorithms in Noise Cancellation for Speech Enhancement,” International Journal of Electronic and Electrical Engineering, vol. 5, Number 6, 2012, 511-513. [6] Chassing Rulph & Reay Donald,“Digital Signal Processing & Application with TMS320C6713 & TMS320C6416 DSK”(ISBN 978-0-470-13866-3, John Wiley & Sons, Inc, Edition 2nd 2008). [7] Paulo S.R. Diniz, “Adaptive Filtering Algorithms and Practical Implementation”(ISBN 978-0-387-31274-3, Kluwer Academic Publishers, Edition 3rd 2008). [8] Alexander D. Poularikas, Zayed M. Ramadan, “Adaptive Filtering Primer with MATLAB”, (ISBN 978-0-8493-7043-4, Taylor & Francis Group, LLC, 2006). [9] M. A. Shanooja and J. Ramesh Kumar, “Low power VLSI architecture for adaptive filter and its application to noise cancellation,”International Journal of Emerging Trends in Engineering and Development, vol. 2, Issue 3, 2013, 366-376.

2663 All Rights Reserved © 2015 IJARECE

Suggest Documents