Speech Signal Processing using Microphones NI 9234 and LabVIEW Radek Martinek, Radana Kahankova, Petr Bilik, Jan Nedoma, Marcel Fajkus, Michal Skacel Faculty of Electrical Engineering and Computer Science, VSB - Technical University of Ostrava 17. listopadu 2172/15, 708 00 Ostrava-Poruba, Czech Republic
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected]
the measured data can be analyzed in an offline application for more detailed analysis and understanding of the issue.
ABSTRACT The paper deals with the speech processing and adaptive filtration. Introduced application is implemented in both online and offline mode in LabVIEW. The online mode program is used to create a database of speech recordings and various interferences from the outdoor environment as well as from the home. The offline application then serves to test adaptive algorithms for the needs of speech processing. The criterion for comparing the efficiency of individual algorithms is primarily to increase the signal to noise ratio. To test the filtration rate, a global SNR method was chosen.
2. THEORETICAL BACKGROUND Our application includes the adaptive system for the noise reduction. This system is using adaptive filter, which will be described in more detail. An adaptive filter is a computational device that iteratively models the relationship between the input and output signals of a filter. An adaptive filter self-adjusts the filter coefficients according to an adaptive algorithm [1]. Figure 1 shows the diagram of a typical adaptive filter, where x(n) is the input signal to (the mixture of noise and the speech in our case), y(n) is the corresponding output signal, d(n) is the second input signal (reference noise signal for our system), and e(n) is the output error signal obtained by subtracting d(n) from y(n). As a linear filter we can use different filters such as finite impulse response (FIR) or infinite impulse response (IIR). Finally, the most important part of whole system is an adaptive algorithm which is able to adjust the linear filter coefficients, see [14], [15], and [16].
CCS Concepts • Software and its engineering➝Software notations and tools ➝Software configuration management and version control systems.
Keywords Signal to Noise Ratio; Voice Activity Detector; Dynamic Time Warping (DTW); Partial Correlation Coefficients; Adaptive Filter; Least Mean Squares; Recursive Least Squares.
1. INTRODUCTION Filtration is one of the basic methods of digital signal processing (DSP) and it is a vital tool for removing interferences that disturb the desired signal, [1], [2], [3], and [4]. Adaptive systems are an important means of data processing. As the name implies, they are systems that are able to adapt (by adjusting the parameters) according to the circumstances. They are used primarily for filtering signals, detecting a useful signal in noise, or identifying an unknown system, see [5], [6], [7], [8], [9], [10], and [11]. The last chapter describes the verification of the functionality of the individual adaptive algorithms, the behavior of the parameters and their optimal setting.
Figure 1. Adaptive algorithm scheme. There are several kinds of algorithms that can be implemented into the proposed adaptive system, such as Least Mean Squares (LMS) algorithms [17], [18], [19] or the Recursive Least Squares (RLS) algorithms [17], and [20]. For the initial phase of the research, we decided to test only Standard LMS algorithm, which is also going to be introduced in the following subsection. In the future, other algorithms will be tested and implemented into the adaptive system.
The aim of the paper is processing of speech signals, recorded my means of Microphones NI 9234 [12], [13], and adaptive filtration in the online mode, i.e. real-time processing in time and frequency domains, filtration and storage of measured data. Subsequently, Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from
[email protected]. ICCMS 2018, January 8–10, 2018, Sydney, Australia © 2018 Association for Computing Machinery. ACM ISBN 978-1-4503-6339-6/18/01…$15.00 https://doi.org/10.1145/3177457.3177501
2.1 Standard LMS The standard LMS algorithm performs the following operations to update the coefficients of an adaptive filter:
9
Calculates the output signal y(n) from the adaptive filter.
Calculates the error signal e(n) by using the following equation:
e(n) d(n) - y(n).
data produced [22]. Data queues are used to communicate data between the loops. These queues offer the advantage of data buffering between producer and consumer loops. Data transmitted between loops is the message about what the user has done on the front panel, and therefore the part of the code corresponding to the appropriate event is always performed.
(1)
Updates the filter coefficients by using the following equation:
w(n+1) w(n) + 2e(n)x(n),
(2)
where μ is the step size of the adaptive filter, w(n) is the filter coefficients vector, and x(n) is the filter input vector. Step size is a crucial parameter that can improve the convergence speed of the adaptive filter. It determines both how quickly and how closely the adaptive filter converges to the filter solution [1]. The LMS filter is then used to identify an FIR signal embedded in noise. The LMS algorithm performed very well, and does not require the signal to be piecewise stationary, and requires no manual operation other than selection of the step-size and the filter order.
3.2 Offline part of the application The algorithm starts by selecting speech and noise recording in TDMS format. If the paths are correctly selected, the user presses the "Load Recording and Noise" button. The signal adjustment button is unlocked, the value field is indexed and the length of the recording is measured in seconds. The signals were recorded at the maximum possible sampling rate of 51200 Hz. Therefore, a signal decimation function has been created. The user can choose decimation step 1 through 6, where 1 is the original recording and 6 corresponds to a sampling frequency of 8555 Hz to maintain the sampling theorem (frequency of human speech ranges from 300 Hz to 3.4 kHz). After decimation, the recordings are plotted.
3. SPEACH PROCESSING SYSTEM DESCRIPTION The application consists of two parts. The first part is an online application for time and frequency speech signal processing. It also allows adaptive real-time filtering, global SNR calculation, and data storage. Speech and noise were recorded using the NI 9234 and G.R.A.S. 40PP [4], [21]. The second part is an offline application for advanced processing by adaptive algorithms.
In the next step, the user must set the length of the recording to ensure that the signal length is same for the purpose of the analysis and computations. After that, the user is able to choose the adaptive algorithm for the data processing. To enable real-time adjusting of parameters, the adaptive algorithm functions were programmed separately outside the producer-consumer architecture. While talking, the sound is reflected and the echo is created. For this reason, the low-pass filter with the length of 5 and a lower limit frequency of 0.1 for the noise delay.
3.1 Online part of the application The program is based on producer-consumer design pattern. This means that one loop produce data, and the second consume the
Figure 2. Application front panel appearance.
10
The user is also able to plot spectrograms. For that, we first need to specify the size of the segment that we create using the initialize array function with the required number (𝑁). The windows are modified by the function array subset to match the specified overlay. The For-loop is used to divide the input signal into segments. The iterations are multiplied in the For-loop with the length of the window and brought to the input of the array subset. This determines the first element for each segment. The adjusted N-counts are multiplied by a window of the same number N, and we calculate their discrete transformation using the FFT algorithm. In the block called array subset, we limit the two-sided spectrum to one-sided one. From this modified spectrum, we obtain absolute values and calculate the power spectrum. Thus, the resulting power spectrum is obtained, see Figure 2. The user can also amplify the loaded recording of the noise for better analysis of adaptive algorithms. In addition, it is possible to choose to store a filtered signal in TDMS or WAV format. To subjectively assess the quality of DSP, the user can play the speech before and after filtering.
4. EXPERIMENTS For commercial communications applications such as teleconferencing, audio acoustics, etc., we often encounter situations where we have to deal with noise problems. To ensure that the system we designed is be able to face the real-life noise, we decided to carry out the experimental measurement, which will be explained in following section (subsection 4.1). The data obtained were then used to find optimal parameters for the utilized adaptive system (see subsection 4.2).
Figure 3. Methodology of the experiments.
4.1 Experimental measurement To test the functionality of our system and also the performance of the adaptive system for the noise filtration, we carried out an experimental measurement of the interference in the electric car Nissan Leaf. Measurement occurred at the speed of 50 km/h in the center of Ostrava, Czech Republic. The signals measured in the rear seat and in the car trunk first with the windows closed, see Figure 3. The sampling frequency was 51 200 Hz. The measurement was carried out using two kinds of microphones G. R. A. S. 40PP: primary and reference one. The microphones were connected to the card NI 9234 and the analysis was performed by a notebook that included the speech signal processing system based on Virtual instrumentation [23], [24]. The example of the signals, obtained during the experiment, is shown in Figure 4. First of them is the desired signal (speech of counting from 1 to 10), the second is the noise, and the third is the signal mixture.
4.2 Optimal Parameters of Adaptive System One of the most important factors to consider when designing any adaptive system are the parameters of the adaptive filters utilized. The values of the parameters vary according the purpose of the system. The optimal setting is different for biomedical applications (see [25], [26], [27]) or telecommunications (see [28], [29]). Therefore, we found it necessary to carry out the experiments that would find the most suitable combination of the parameters (filter length and step size) for the LMS algorithm. In this subsection we will introduce the influence of the filter parameters (filter length M and convergence constant μ). Beside filtration quality, these parameters influence convergence rate, and duration of the filtration.
Figure 4. Examples of the signals used for the experiments.
4.2.1 Filter Length One of the important input parameters of adaptive algorithms is the length of the filter, denoted as 𝑀. The order of the filter 𝑁 is described as 𝑁 = 𝑀-1.
4.2.2 Step Size Convergence constant, or step size, μ, have an effect on the speed of adaptation of filter weights. It is a small positive constant that affects the algorithm adaptation properties. If it is large, it is due to the presence of a useful signal to consider balances. The
11
concept of the small and large value of parameter μ is related to the scattering of the input signal.
[2] Benesty, J., & Huang, Y. (Eds.). (2013). Adaptive signal processing: applications to real-world problems. Springer Science & Business Media.
4.2.3 Results
[3] Smith, S. (2013). Digital signal processing: a practical guide for engineers and scientists. Newnes.
The tests were evaluated by the value of output SNR. Figure 5 illustrates the results. According to the rule the lower the better, it is obvious that the best results are achieved when choosing a small value of the step size and filter length.
[4] Martinek, R., Kelnar, M., Vanus, J., Bilik, P., & Zidek, J. (2015). A robust approach for acoustic noise suppression in speech using anfis. Journal of Electrical Engineering, 66(6), 301-310.
Additionally, Table 1 shows that when the convergence constant decreases, the algorithm will take longer to settle at the optimum value. This means that the algorithm needs a number of iterations to bring the adaptive filter closer to the optimum state of filtration. Furthermore, at a set value of the convergence constant to 0.001, it is obvious that the filter takes too long to adapt to the optimum value.
[5] Farhang-Boroujeny, B. (2013). Adaptive filters: theory and applications. John Wiley & Sons. [6] Haykin, S. O. (2013). Adaptive filter theory. Pearson Higher Ed. [7] Martinek, R., Zidek, J., Bilik, P., Manas, J., Koziorek, J., Teng, Z., & Wen, H. (2013). The use of lms and rls adaptive algorithms for an adaptive control method of active power filter. Energy and Power Engineering, 5(04), 1126. [8] Martinek, R., Kelnar, M., Koudelka, P., Vanus, J., Bilík, P., Janku, P., ... & Zidek, J. (2015). Enhanced processing and analysis of multi-channel non-invasive abdominal foetal ECG signals during labor and delivery. Electronics Letters, 51(22), 1744-1746. [9] Martinek, R., Manas, J., Zidek, J., & Bilik, P. (2013, July). Power quality improvement by shunt active performance filters emulated by artificial intelligence techniques. In Conference Proceedings: 2nd International Conference on Advances in Computer Science and Engineering (CSE 2013). Los Angeles, CA, USA (pp. 157-161).
Figure 5. The influence of filter parameters on the filtration quality. Table 1. The influence of the filter parameters on filtration time and number of iteration.
[10] Comminiello, D., Scarpiniti, M., Azpicueta-Ruiz, L. A., Arenas-Garcia, J., & Uncini, A. (2013). Functional link adaptive filters for nonlinear acoustic echo cancellation. IEEE Transactions on Audio, Speech, and Language Processing, 21(7), 1502-1512.
μ (-)
M (-) 5
50
100
0.1
0.01
0.001
0.33
0.19
0.02
0.27
5.42
Too long
16896
9728
1024
13824
277504
Too high
Time (s) Iterations (samples)
[11] Tan, Y., He, Z., & Tian, B. (2015). A novel generalization of modified LMS algorithm to fractional order. IEEE Signal Processing Letters, 22(9), 1244-1248. [12] Banaś, W., Gwiazda, A., Herbuś, K., Kost, G., Ociepka, P., & Reclik, D. (2015). Analysis of the dynamic properties of the mechatronic integrator of control procedures of the vehicle driven by persons with disabilities. In Solid State Phenomena (Vol. 220, pp. 3-8). Trans Tech Publications.
5. CONCLUSION The aim of the paper was to design and implement application in both online and offline mode in LabVIEW [30], [31], and [32] development environment for recording and analysis of audio signals in time and frequency domain. An online application has created a database of speech signals and interferences occurring especially in the surrounding environment. These recordings were subsequently used in an offline application within experiments conducted on which both the basic groups of the adaptive LMS, RLS algorithms were tested.
[13] Vashist, S. K., & Chhabra, D. (2014, March). Optimal placement of piezoelectric actuators on plate structures for active vibration control using genetic algorithm. In Proc. SPIE (Vol. 9057, p. 905720). [14] Åström, K. J., & Wittenmark, B. (2013). Adaptive control. Courier Corporation. [15] Vanus, J., Smolon, M., Martinek, R., Koziorek, J., Zidek, J., & Bilik, P. (2015). Testing of the voice communication in smart home care. Human-Centric Computing and Information Sciences, 5(1), 1-22.
6. ACKNOWLEDGMENTS The research received a financial support from the SGS grant No. SP2017/128, VSB-Technical University of Ostrava, Czech Republic.
[16] Martinek, R., Vanus, J., Bilik, P., Al-Wohaishi, M., Zidek, J., & Wen, H. (2016, May). The implementation of equalization algorithms for real transmission channels. In Instrumentation and Measurement Technology Conference Proceedings (I2MTC), 2016 IEEE International (pp. 1-6). IEEE.
7. REFERENCES [1] Widrow, Bernard, and Samuel D. Stearns. Adaptive signal processing. Vol. 15. Englewood Cliffs, NJ: Prentice-hall, 1985.
[17] Martinek, Radek, and Jan Zidek. "Use of adaptive filtering for noise reduction in communications systems." Applied
12
Electronics (AE), 2010 International Conference on. IEEE, 2010.
Approach for Optimization of Adaptive Filter Control Parameters Using the LMS and RLS Algorithms." Sensors 17.5 (2017): 1154.
[18] Martinek, Radek, and Jan Zidek. "The real implementation of NLMS channel equalizer into the system of software defined radio." Advances in Electrical and Electronic Engineering 10.5 (2012): 330.
[26] Martinek, Radek, et al. "A phonocardiographic-based fiberoptic sensor and adaptive filtering system for noninvasive continuous fetal heart rate monitoring." Sensors 17.4 (2017): 890.
[19] Sambur, Marvin. "Adaptive noise canceling for speech signals." IEEE Transactions on Acoustics, Speech, and Signal Processing 26.5 (1978): 419-423.
[27] Kahankova, Radana, Radek Martinek, and Petr Bilik. "Noninvasive Fetal ECG Extraction from Maternal Abdominal ECG Using LMS and RLS Adaptive Algorithms." International Afro-European Conference for Industrial Advancement. Springer, Cham, 2016.
[20] Martinek, Radek, and J. BILIK. "P.: New Strategies for Application of Recursive Least Square Algorithm in Active Power Filters." 8th International Scientific Symposium on Electrical Power Engineering (Elektroenergetika), Stara Lesna, Slovakia. 2015.
[28] Martinek, Radek, et al. "Optimization of the Training Symbols for Minimum Mean Square Error Equalizer." International Afro-European Conference for Industrial Advancement. Springer, Cham, 2016.
[21] Peters, C. J., Miles, R. B., Burns, R. A., Danehy, P. M., Bathel, B. F., & Jones, G. S. (2016, June). Femtosecond laser tagging characterization of a sweeping jet actuator operating in the compressible regime. In 32nd AIAA Aerodynamic Measurement Technology and Ground Testing Conference (p. 3248).
[29] Wang, L-X., and Jerry M. Mendel. "Fuzzy adaptive filters, with application to nonlinear channel equalization." IEEE Transactions on Fuzzy Systems 1.3 (1993): 161-170. [30] Travis, J., & Kring, J. (2007). LabVIEW for everyone: graphical programming made easy and fun. Prentice-Hall.
[22] Monroe, Robert T., et al. "Architectural styles, design patterns, and objects." IEEE software 14.1 (1997): 43-52.
[31] Martinek, R., Kelnar, M., Koudelka, P., Vanus, J., Bilik, P., Janku, P., ... & Zidek, J. (2016). A novel LabVIEW-based multi-channel non-invasive abdominal maternal-fetal electrocardiogram signal generator. Physiological measurement, 37(2), 238.
[23] Martinek, R., Sincl, A., Vanus, J., Kelnar, M., Bilik, P., Machacek, Z., & Zidek, J. (2016). Modelling of fetal hypoxic conditions based on virtual instrumentation. In Proceedings of the Second International Afro-European Conference for Industrial Advancement AECIA 2015 (pp. 249-259). Springer, Cham.
[32] Martinek, R., Sincl, A., Vanus, J., Kelnar, M., Bilik, P., Machacek, Z., & Zidek, J. (2016). Modelling of fetal hypoxic conditions based on virtual instrumentation. In Proceedings of the Second International Afro-European Conference for Industrial Advancement AECIA 2015 (pp. 249-259). Springer, Cham.
[24] Thooyamani, K. P., Khanaa, V., & Udayakumar, R. (2014). Virtual instrumentation based process of agriculture by automation. Middle-East Journal of Scientific Research, 20, 12. [25] Martinek, Radek, et al. "Non-Invasive Fetal Monitoring: A Maternal Surface ECG Electrode Placement-Based Novel
13