Introduction to NLMS Adaptive Filtering in Matlab

Slide Note
Embed
Share

Explore NLMS adaptive filtering, a powerful method for signal processing applications, particularly in acoustic echo cancellation. Learn about the NLMS algorithm, its comparison with the LMS algorithm, and the key parameters involved in tuning for optimal performance. Dive into practical experiments for measuring echo paths and generating signals using Matlab. Enhance your understanding of digital signal processing techniques through hands-on NLMS implementation.


Uploaded on Dec 11, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Digital Signal Processing Lab 5: NLMS adaptive filtering in Matlab Toon van Waterschoot, Marc Moonen ESAT Departement of Electrical Engineering KU Leuven, Belgium

  2. Digital Signal Processing: Lab Sessions Session 1: Signal generation & analysis in Matlab Session 2: Embedded DSP implementation of energy-based voice activity detector Session 3: Filter analysis & implementation in Matlab Session 4: Embedded DSP implementation of FIR filter Session 5: NLMS adaptive filtering in Matlab Session 6: Embedded DSP implementation of NLMS adaptive filter Session 7: Embedded DSP implementation of acoustic echo canceller 2 Image source: bigdata-madesimple.com

  3. Acoustic Echo Cancellation One of the most exemplary applications of adaptive filtering is acoustic echo cancellation (AEC) In a hands-free voice communication scenario, the loudspeaker signal is fed back to the microphone through direct acoustic coupling as well as acoustic reflections AEC is possible by estimating an acoustic echo path model to predict and subtract an echo signal estimate echo path model echo path + 3

  4. NLMS adaptive filtering Two particularly popular adaptive filtering algorithms are Least Mean Squares (LMS) algorithm Normalized Least Mean Squares (NLMS) algorithm Both algorithms recursively estimate a length-L FIR echo path model using a length-Linput signal buffer and an a priori error signal computed from the microphone signal y 4

  5. NLMS adaptive filtering Both LMS and NLMS can produce an echo-compensated signal The LMS and NLMS algorithms require careful tuning of the step size parameter the regularization parameter (NLMS only) The choice of these parameters is typically based on a trade-off between convergence speed steady-state error variance 5

  6. NLMS adaptive filtering in Matlab Experiment 5.1: Measurement of laptop echo path Download and unzip the folder Exp5.1. Use the function expsweep to generate an exponential sine sweep (ESS) signal of length 2 s, sweeping from 100 Hz to 7500 Hz, sampled at 16 kHz. Install Audacity or any other audio player that can simultaneously play back and record audio. Import the ESS signal into Audacity, make sure software playthrough is turned off, and hit the record button. Export the recording to a WAV file and read it into Matlab. Use the function sweepIR function to calculate the echo path impulse response from the recorded signal. 6

  7. NLMS adaptive filtering in Matlab Exercise 5.1: Analysis/simulation of laptop echo path Plot the impulse response and the frequency response of the measured echo path. Take your time to interpret the results and compare with your colleagues. Note that the results for different laptops may be very different! Download the WAV file Ex5_1.wav. Read the WAV file into Matlab and filter the resulting speech signal with the measured echo path. Listen to the original speech and the filtered speech. How do they differ? Generate a Gaussian white noise signal of 60 s, sampled at 16 kHz and filter it with the measured echo path. 7

  8. NLMS adaptive filtering in Matlab Exercise 5.2: LMS adaptive filter driven by white noise Write a Matlab algorithm that applies the LMS algorithm with the Gaussian white noise signal as its input signal, and the filtered Gaussian white noise signal as its microphone signal. For each recursion of the LMS algorithm, compute the misalignment = squared difference between the estimated echo path model and the true echo path. At the end of the experiment, plot the misaligment vs. the recursion index. Repeat this procedure for different values of the step size parameter in the range , and plot the resulting misalignment curves on top of each other. What does this tell you about the choice of the step size? Plot and play back the echo-compensated signal. 8

  9. NLMS adaptive filtering in Matlab Exercise 5.3: (N)LMS adaptive filter driven by speech Modify the Matlab algorithm such that it takes the speech signal as its input and the filtered speech signal as its microphone signal. Redo the misadjustment comparison for different step size values. What do you conclude? Modify the LMS algorithm into an NLMS algorithm, and repeat the misadjustment comparison for different step size values using a fixed regularization parameter . Plot and play back the echo-compensated signals resulting from LMS and NLMS. Can you explain the difference between the LMS and NLMS behavior? Which is more suitable for speech and why? 9

Related


More Related Content