Simulation and hardware implementation of Adaptive algorithms on tms320 c6713 digital signal processor

3,551 views

Published on

Published in: Education, Technology
1 Comment
11 Likes
Statistics
Notes
No Downloads
Views
Total views
3,551
On SlideShare
0
From Embeds
0
Number of Embeds
942
Actions
Shares
0
Downloads
0
Comments
1
Likes
11
Embeds 0
No embeds

No notes for slide

Simulation and hardware implementation of Adaptive algorithms on tms320 c6713 digital signal processor

  1. 1. A Dissertation Presentation on “Simulation and Hardware Implementation of NLMS algorithm on TMS320C6713 Digital Signal Processor” Presented by: Raj Kumar Thenua M.Tech IV Sem. Roll No. 07ESODC611 Under Guidance of: Mr. S.K. Agrawal Associate Professor Deptt. of ECE Sobhasaria Engineering College, Sikar, Rajasthan
  2. 2. Presentation Outline              Introduction Adaptive Noise Cancellation System Adaptive Algorithms MATLAB Simulation Results Analysis Performance comparison of various adaptive algorithms Experimental Setup using DSP hardware Simulink Model DSP Processor Results Analysis Conclusions Future Scope Applications Publications References 2
  3. 3. INTRODUCTION  During transmission of information, noise gets added to the signal from the surroundings automatically .  Reduces the perceived quality or intelligibility.  Effective removal of noise is an active area of research .  Adaptive filters are capable of learning from the statistics of current conditions.  Change filter coefficients in order to achieve a certain goal.  Can work effectively in unknown environment. 3
  4. 4. Adaptive Filter Three Major Specification  Input  Filter structure  Algorithm FIR IIR NLMS TVLMS ECLMS LMS RLS FT RLS Fig.1 (a): Basic block diagram of an adaptive filter 4
  5. 5. Adaptive Noise Cancellation System Adaptive Algorithm Fig.1(b): Block diagram of an adaptive noise cancellation system 5
  6. 6. Least Mean Squared (LMS) Algorithm  Filter weights are updated by the following formula for each iteration: w ( n  1)  w ( n )  2  e ( n ) x ( n ) Here x(n) is the input vector of time delayed input values, x ( n )  [ x ( n ) x ( n  1) x ( n  2 )..... x ( n  N  1)]    T w(n) represents the coefficients of the adaptive FIR filter tap weight vector at time n. μ is known as the step size, (fixed). If μ is too small ;converge on the optimal solution will be too long; if μ is too large; the adaptive filter becomes unstable and its output diverges. 6
  7. 7. Normalized Least Mean Squared (NLMS) Algorithm   The step size is normalized by the input signal power. The NLMS is always the favorable choice of algorithm for fast convergence speed and for nonstationary input. w ( n  1)  w ( n )    c  x(n) 2 e(n) x(n) α: NLMS adaption constant, which optimize the convergence rate of algorithm.  0<α<2 (practically <1)  c : constant term for normalization 7
  8. 8. Recursive Least Square (RLS) Algorithm    RLS algorithms are known for excellent performance when working in time varying environments. Increased computational complexity and some stability problems. Filter tap weight vector is updated using equation w n   w  T  n  1   k  n e n 1  n  Intermediate gain vector  k n   u n  /   x 1  T  n u  n  u ( n )  w  ( n  1) x ( n ) The filter output is calculated using the filter tap weights from the previous iteration and the current input vector. y n 1  n   w T n  1 x n  e n 1  n   d  n   y n 1  n  8
  9. 9. Results Analysis  MATLAB Simulation    Tone Signal analysis( LMS, NLMS,RLS) Performance Analysis of discussed algorithms DSP Processor Implementation   Tone Signal Analysis( NLMS) ECG Signal Analysis (LMS, NLMS) 9
  10. 10. Result Analysis (MATLAB Simulation) Fig.2: MATLAB simulation for LMS algorithm; N=19, step size=0.001 10
  11. 11. Result Analysis (MATLAB Simulation) Fig.3: MSE versus Step-size (µ) for LMS algorithm 11
  12. 12. Result Analysis (MATLAB Simulation) Table 1 MSE VERSUS STEP-SIZE (µ) FOR LMS ALGORITHM S.N. Step-size(µ) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 0.0001 0.0002 0.0003 0.0004 0.0005 0.0006 0.0007 0.0008 0.0009 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01 Mean Squared Error(MSE) 0.1281 0.0738 0.0516 0.0404 0.0340 0.0300 0.0275 0.0259 0.0249 0.0244 0.0308 .0448 0.0618 0.0805 0.1005 0.1215 0.1437 0.1671 0.1918 12
  13. 13. Result Analysis (MATLAB Simulation) Contd... Fig.4: MATLAB simulation for NLMS algorithm; N=19, step size=0.001 13
  14. 14. Result Analysis (MATLAB Simulation) Contd... Fig.5: MATLAB simulation for RLS algorithm; N=19 14
  15. 15. Result Analysis (MATLAB Simulation) Contd... Table 2 PERFORMANCE COMPARISON OF VARIOUS ADAPTIVE ALGORITHMS S.N Algorithm 1. 2.5×10-2 NLMS 2.1×10-2 91.62% 93.85% 2N+1 Stability (39) 2. LMS Mean % Noise Complexity Squared Reduction (No. of Error (MSE) multiplications per iteration) Highly Stable 3N+1 Stable (58) 3. RLS 1.7×10-2 98.78% 4N2 less Stable (1444) 15
  16. 16. Result Analysis (MATLAB Simulation) Contd... N=19 Fig.6: MSE versus filter order(N) for LMS ,NLMS & RLS 16
  17. 17. DSP Processor Experimental Setup Fig.7: Experimental Setup for DSP processor 17
  18. 18. Fig.8: DSP Processor interfaced with CRO and PC 18
  19. 19. Hardware Implementation Experimental Setup Fig.9: Real-time Experimental Setup for DSP processor 19
  20. 20. Simulink Model Fig.10: ANC simulink model 20
  21. 21. Result Analysis (DSP Processor)  Tone Signal Analysis: A clean tone ( Sinusoidal) signal of 2-dB power and 1 KHz frequency is generated using function generator. Fig.11: Clean and Noisy tone signals 21
  22. 22. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis: Fig.12: Filtered output 22
  23. 23. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis: Fig.13: Time delay in filtered signal 23
  24. 24. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis at various Frequencies: Fig.14: Filtered output at 2kHz,3kHz,4kHz and 5kHz frequencies 24
  25. 25. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis at various Amplitudes: Fig.15: Filtered outputs for 2V,3V,4V and 5V input signals 25
  26. 26. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis at High Noise Environment: Fig.16: Filtered output at high noise 26
  27. 27. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis Table 3 SNR IMPROVEMENT VERSUS VOLTAGE AND FREQUENCY S.N. Amplitude (V) Frequency (kHz) 1. 2. 3. 4. 5. 6. 7. 8. 2 3 4 5 2 2 2 2 1 1 1 1 2 3 4 5 SNR Improvement (dB) 11.00 11.52 11.93 12.80 11.58 11.93 12.08 11.66 27
  28. 28. Result Analysis (DSP Processor) Contd...  Tone Signal Analysis Table 4 SNR IMPROVEMENT VERSUS NOISE LEVEL FOR A TONE SIGNAL S.N. Noise Level Noise Variance 1. 2. 3. Low Medium High 0.02 0.05 0.15 SNR Improvement (dB) 13 12 10 28
  29. 29. Result Analysis (DSP Processor) Contd...  ECG Signal Analysis: A clean (amplified) ECG signal with 1000 sample values, of amplitude 260mV and frequency 35 Hz, generated through twelve lead configurations, sampled at a frequency of 1.5 kHz. Fig.17: Clean ECG signal 29
  30. 30. Result Analysis (DSP Processor) Contd...  ECG Signal Analysis: (Low level noise) (a) LMS (b) NLMS Fig.18: Filter output at low noise level 30
  31. 31. Result Analysis (DSP Processor) Contd...  ECG Signal Analysis: (Medium level noise) (a) LMS (b) NLMS Fig.19: Filter output at medium level noise 31
  32. 32. Result Analysis (DSP Processor) Contd...  ECG Signal Analysis: (High level noise) (a) LMS (b) NLMS Fig.20: Filter output at high level noise 32
  33. 33. Result Analysis (DSP Processor) Contd...  ECG Signal Analysis: Table 5 SNR IMPROVEMENT VERSUS NOISE LEVEL FOR AN ECG SIGNAL S.N. Noise Level 1. 2. 3. Low Medium High Sampling Rate (kHz) 1.5 1.5 1.5 SNR Improvement NLMS (dB) 9.89 8.62 6.38 SNR Improvement LMS (dB) 8.85 7.55 5.12 33
  34. 34. Result Analysis (DSP Processor) Contd...   The above results justify that the proposed real-time hardware implementation of NLMS algorithm shows a considerable improvement in the SNR of a noisy signal. And the performance of the proposed system is better than the LMS based systems. The hardware implementation of NLMS algorithm enables one to work with real-time biomedical and other kind of signals whereas simulation does not provide real-time working environment. 34
  35. 35. Conclusions      The three adaptive filter algorithms; LMS, NLMS & RLS are implemented on MATLAB and the simulation results are analyzed. A fair performance comparison is presented among the discussed algorithms based the various performance parameters like MSE, convergence speed, computational complexity etc. The resulted best algorithm (i.e. NLMS) is implemented on the TMS320C6713 processor for real-time noise cancellation. The real-time processor results are analyzed for two types of signals; tone signal and ECG signal, with the help of DSO. Filter performance is measured in terms of SNR improvement. 35
  36. 36. Future Scope     Considering the nature of the experiment, there are a number of viable directions for the extension of the research. An interesting extension would be implementing different kind of adaptive filters that will perform with faster convergence and better noise reduction. The system was implemented using auto C code generation which takes more memory on the board which limits the hardware performance. Coding in assembler could allow for further optimization and an improvement in the systems performance. The implemented noise cancellation system is mainly analysed for tone signals and ECG signals. However someone can also analysed it for other kind of noise corrupted signals. 36
  37. 37. Future Scope Contd...   This Dissertation dealt with transversal FIR adaptive filters, this is only one of many methods of digital filtering. Other techniques such as infinite impulse response (IIR) or lattice filtering may prove to be more effective in an adaptive noise reduction application but asking for enough memory requirements. Wavelet transforms could give advantages or disadvantages in different aspects of the application. Such an experiment could be done on the same or similar hardware as the one used in this experiment. 37
  38. 38. Real Time Applications of ANC System: Application 1:  To measure the ECG of a pregnant lady and her baby which is to be born, measurement of mother’s ECG is simple but it is very difficult for the baby, here the concept of adaptive filtering is used. The mother’s heart sound acts as a noise signal and we have to cancel that noise using various adaptive algorithms. 38
  39. 39. Application 2:  Motion artifact spectroscopy cancellation in NIR 39
  40. 40. Application-3:  The noise removal from the pilot’s microphone in the airplane. Due to the high environmental noise produced by the airplane engines, the pilot’s voice in the microphone is distorted with a high amount of noise, and can be very difficult to understand. In order to overcome the problem, an adaptive filter can be used. 40
  41. 41. Application-4:  Improving the Response of Accelerometers for Automotive Applications 41
  42. 42. Publications International/ National Journals [1] Raj kumar Thenua and S.K. Agarwal “Simulation and Performance Analysis of Adaptive Filter in Noise Cancellation”, International Journal of Engineering Science and Technology (IJEST), ISSN: 0975-5462, Vol. 2(9), 2010, Page no. 4374-4379. (Published) 42
  43. 43. Publications Contd... International/ National Conferences [2] Raj kumar Thenua and S.K. Agarwal, “Hardware Implementation of Adaptive algorithms for Noise Cancellation”, IEEE International Conference on Network Communication and Computer (ICNCC 2011), 21st -23rd Mar 2011, organized by International Association of Computer Science and Information Technology (IACSIT) and Singapore Institute of Electronics (SIE) at New Delhi, India. (Published) [3] Raj kumar Thenua, S.K. Agarwal and Ayub khan “Performance analysis of Adaptive Noise Canceller for an ECG signal” International Conference on Recent Trends in Engineering, Technology and Management, 26th -27th Feb 2011 at BIET, Jhansi. (Published). [4] Raj kumar Thenua and S.K. Agarwal, “Hardware Implementation of NLMS Algorithm for Adaptive Noise Cancellation”, National Conference on Electronics and Communication (NCEC-2010) on 22nd -24th December 2010 at MITS, Gwalior. (Published) 43
  44. 44. Publications Contd... International/ National Conferences [5] Raj kumar Thenua and S.K. Agarwal “Real-time Noise Cancellation using Digital Signal Processor” National conference on Electronics, Computers and Communications (NCECC-2010) on 06th -07th March 2010 at MITS, Gwalior. (Published) 44
  45. 45. References [1] Bernard Widrow, John R. Glover, John M. Mccool, John Kaunitz, Charles S. Williams, Robert H. Hean, James R. Zeidler, Eugene Dong, Jr. and Robert C. Goodlin, “Adaptive Noise Cancelling: Principles and Applications”, Proceedings of the IEEE, 1975, Vol.63 , No. 12 , Page(s): 1692 – 1716. [2] Slock, D.T.M., “On the convergence behavior of the LMS and the normalized LMS algorithms”, IEEE Transactions on Signal Processing, 1993, Vol. 41, Issue 9, pp. 2811-2825. [3] Abhishek Tandon, M. Omair Ahmad, “An efficient, low-complexity, normalized LMS algorithm for echo cancellation” The 2nd Annual IEEE Northeast Workshop on Circuits and Systems, 2004. NEWCAS 2004, Page(s): 161 – 164. [4] Sanaullah Khan, M.Arif and T.Majeed, “Comparison of LMS, RLS and Notch Based Adaptive Algorithms for Noise Cancellation of a typical Industrial Workroom”, 8th International Multitopic Conference, 2004, Page(s): 169 – 173. [5] Yuu-Seng Lau, Zahir M. Hussian and Richard Harris, “Performance of Adaptive Filtering Algorithms: A Comparative Study”, Australian Telecommunications, Networks and Applications Conference (ATNAC), Melbourne, 2003. [6] Constantin Paleologu,“Variable Step-Size NLMS Algorithm for Under-Modeling Acoustic Echo Cancellation” IEEE SIGNAL PROCESSING LETTERS, VOL. 15, 2008, Page(s): 5 – 8. 45
  46. 46. References [7] DONG Hang and SUN Hong, “ Multirate Algorithm for Updating the Coefficients of Adaptive Filter”, First International Conference on Intelligent Networks and Intelligent Systems, Nov-2008,Page(s): 581 – 584. [8] Ying He Hong He Li Li Yi Wu and Hongyan Pan, “The Applications and Simulation of Adaptive Filter in Noise Canceling”, 2008 International Conference on Computer Science and Software Engineering, 2008, Vol.4, Page(s): 1 – 4. [9] Michail D. Galanis and Athanassios Papazacharias, “A DSP Course for RealTime Systems Design and Implementation based on TMS320C6211 DSK”, 14th International Conference on Digital Signal Processing, 2002, Vol.2, Page(s): 853 – 856. [10]Gaurav Saxena, Subramaniam Ganesan, and Manohar Das, “Real time implementation of adaptive noise cancellation”, 2008 IEEE International conference on electro/information technology , Page(s): 431 – 436. [11]Duran Villalobos, C.A.; Tavares Reyes, J.A.; Sanchez Garcia, J.C, “Implementation and Analysis of the NLMS Algorithm on TMS320C6713 DSP”, 52nd IEEE International Midwest Symposium on Circuits and Systems, Aug2009, Page(s): 1091 – 1096. 46
  47. 47. References [12] Boo-Shik Ryu, Jae-Kyun Lee, Joonwan Kim, Chae-Wook Lee, “The Performance of an adaptive noise canceller with DSP processor”, 40th IEEE Southeastern Symposium on System Theory, March- 2008 , Page(s): 42 – 45. [13] Gerardo Avalos, Daniel Espinobarro, Jose Velazquez, Juan C. Sanchez, “Adaptive Noise Canceller using LMS algorithm with codified error in a DSP”, 52nd IEEE International Midwest Symposium on Circuits and Systems, Aug2009, Page(s): 657 – 662. [14] Hasnain, S.K. Daruwalla, A.D. Saleem, “A unified approach in audio signal processing using the TMS320C6713 and Simulink blocksets”, 2nd International Conference on Computer, Control and Communication, 2009, page(s): 1 – 5. [15] Simon Haykin, “Adaptive Filter Theory”, ISBN 978-0130901262, Prentice Hall, 4th edition-2001. [16] Paulo S.R. Diniz, “Adaptive Filtering: Algorithms and Practical Implemetations” ,ISBN 978-0-387-31274-3, Kluwer Academic Publisher © 2008 Springer Science+Business Media, LLC. [17] Texas Instruments Tutorial, “TMS320C6713 Floating-Point Digital Signal Processor”, (December 2001 – Revised November 2005), SPRS186L [18] The Mathworks Inc. Matlab User’s Guide, 2008. 47
  48. 48. References [19] Farid Ykhlef, A. Guessoum and D. Berkani, “Fast Recursive Least Squares Algorithm for Acoustic Echo Cancellation Application”, 4th International Conference: Sciences of Electronic,Technologies of Information and Telecommunications March 25-29, 2007 – TUNISIA. [20] G. Di Natale, A. Serra, C. Turcotti, “A Board Implementation for Fast APA Acoustic Echo Canceller Using ADSP-21065L DSP”, IEEE International Conference on Automation, Quality Testing and Robotics,May-2006,Vol-2, Page(s): 339 – 344. [21] Wee Chong Chew and Dr B. Farhang Boroujeny, “Software Simulation and Realtime Implementation of Acoustic Echo Cancelling”, International Conference on Information, Communications and Signal Processing, 1997, Vol.3, Page(s): 1270 – 1274. [22] Andy W. H. Khong, “Stereophonic Acoustic Echo Cancellation Employing Selective-Tap Adaptive Algorithms”, IEEE Transactions on Audio, Speech, and Language Processing, Vol. 14, No. 3, May 2006. [23] Sen. M. Kuo and Huan Zhao, “A Real-Time Acoustic Echo Cancellation System”, IEEE International Conference on Systems Engineering, 1990, Page(s): 168 – 171. [24] Masahiro Yukawa, Rodrigo C. de Lamare, and Raimundo Sampaio-Neto, “Efficient Acoustic Echo Cancellation With Reduced-Rank Adaptive Filtering Based on Selective Decimation and Adaptive Interpolation ”, IEEE Transactions on Audio, Speech, and Language Processing, Vol. 16, No. 4, May 2008. 48
  49. 49. References [25] Amit S. Chhetri, Jack W. Stokes, Dinei A. Florˆencio, “Acoustic Echo Cancelation for High Noise Environments”, IEEE International Conference on Multimedia and Expo 2006, Page(s): 905 – 908. [26] Edgar Andrei Vega Ochoa and Manuel Edgardo Guzman Renteria, “A real time acoustic echo canceller implemented on the Motorola DSP56307”, IEEE International Symposium on Industrial Electronics, 2000, Vol.2, Page(s): 625 - 630 [27] Irina Dornean, Marina Topa, Botond Sandor Kirei and Marius Neag, “SubBand Adaptive Filtering for Acoustic Echo Cancellation”, European Conference on Circuit Theory and Design ,2009 , Page(s): 810 – 813. [28] Thomas Schevtlev, “Selective Block Update of NLMS type Algorithms”, IEEE International Conference on Acoustics, Speech and Signal Processing, 1998, Vol.3, Page(s): 1717 – 1720. [29] Texas Instruments Tutorial, “TMS320C6713 Floating-Point Digital Signal Processor”, (December 2001 – Revised November 2005), SPRS186L [30] http://www.dsprelated.com/groups/matlab/1.php [31] http://www.mathworks.com/ 49
  50. 50. 50
  51. 51. 51

×