This commit is contained in:
Patrick Hangl
2025-12-09 16:38:12 +01:00
parent a72898293a
commit 329837548b
6 changed files with 48 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 KiB

View File

@@ -1,8 +1,8 @@
\section{High level simulations}
The main purpose of the high-level simulations is to verify and demonstrate the theoretical approach of the previous chapters and to evaluate the performance of the proposed algorithms under various conditions. The following simulations include different scenarios such as, different types of noise signals and different cosniderations of transfer functions. The goal is to verify different approaches before taking the step to the implementation of said algorithms on the low-power DSP.\\ \\
The implementation is conducted in Python, which provides a flexible environment for numerical computations and data visualization. The simulation is graphically represented using the Python library Matplotlib, allowing for clear visualization of the results.
\subsection{LMS algorithm implementation}
The high-level implementation of the LMS algorithm follows the theoretical framework outlined in Subchapter 2.5, specificially Equation \ref{equation_lms}. The algorithm is designed to adaptively filter out noise from a desired signal using a reference noise input. The implementation of the LMS-function includes the following key steps:
\subsection{ANR algorithm implementation}
The high-level implementation of the ANR algorithm follows the theoretical framework outlined in Subchapter 2.5, specificially Equation \ref{equation_lms}. The algorithm is designed to adaptively filter out noise from a desired signal using a reference noise input. The implementation of the ANR-function includes the following key steps:
\begin{itemize}
\item Initialization: Define vectors to store the filter coefficients, the output samples, and the updated filter coefficients over time.
\item Filtering Process: After initially enough input samples (= number of filter coeffcients) passed the filter, for each sample in the input sample, the filter coefficients are multiplied with the corresponding reference noise samples before added to an accumulator.
@@ -10,11 +10,11 @@ The high-level implementation of the LMS algorithm follows the theoretical frame
\item Coefficient Update: The filter coefficients are updated by the corrector, which consists out of the error signal, scaled by the step size. The adaption step parameter allows to control how often the coefficients are updated.
\item Iteration: Repeat the process for all samples in the input signal.
\end{itemize}
The flow diagram in Figure \ref{fig:fig_lms_logic} illustrates the logical flow of the LMS algorithm, while the code snippet in Figure \ref{fig:fig_lms_code} provides the concrete code implementation of the LMS-function.
The flow diagram in Figure \ref{fig:fig_lms_logic} illustrates the logical flow of the ANR algorithm, while the code snippet in Figure \ref{fig:fig_lms_code} provides the concrete code implementation of the ANR-function.
\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{Bilder/fig_lms_logic.jpg}
\caption{Flow diagram of the code implementation of the LMS algrotihm.}
\caption{Flow diagram of the code implementation of the ANR algrotihm.}
\label{fig:fig_lms_logic}
\end{figure}
\begin{figure}[H]
@@ -42,9 +42,9 @@ The flow diagram in Figure \ref{fig:fig_lms_logic} illustrates the logical flow
return output, coefficient_matrix
\end{lstlisting}
\label{fig:fig_lms_code}
\caption{High-level implementation of the LMS algorithm in Python}
\caption{High-level implementation of the ANR algorithm in Python}
\end{figure}
\subsection{Simple LMS usecases}
\subsection{Simple ANR usecases}
To evaltuate the general functionality and performance of the LMS algorithm from Figure \ref{fig:fig_lms_code} a set of three simple, artificial scenarios are introduced. These examples shall serve as a showcase to demonstrate the general functionality, the possibilities and the limitations of the LMS algorithm. In contrary to a more complex and realistic setup, which will be reviewed afterwards, the clean signals are available, which is in a realistic application not the case.\\ \\
In all three scenarios, a chirp signal with a frequency range from 100-1000 Hz is used as the target signal, which is then corrupted with a sine wave (Usecase 1 and 2) or a gaussian white noise (Usecase 3) as noise signal respectively. In this simple setup, the corrpution noise signal is also available as the reference noise signal. Every approach is conducted with 16 filter coefficients and a stepsize of 0.01. The four graphs in the repsective first plot show the target signal, the corrupted target signal, the reference noise signal and the filter output. The two graphs in the respective second plot show the performance of the filter in form of the resulting error signal and the evolution of three filter coefficients over time.\\ \\
\noindent This artificial setup could be solved analitically, as the signals do not pass seperate, different transfer functions. This means, that the reference noise signal is the same as the corruption noise signal. This simple setup would not require an adaptive filter approach, but it nevertheless allows to clearly evaluate the performance of the LMS algorithm in different scenarios. Also, due to the fact that the target signal is known, it is possible to graphically evaluate the performance of the algorithm in a simple way.
@@ -93,23 +93,51 @@ The error signal in Figure \ref{fig:fig_plot_2_noise.png} shows a noticeable var
\caption{Error signal and filter coefficient evolution of simple usecase 3}
\label{fig:fig_plot_2_noise.png}
\end{figure}
\subsection{Intermediate LMS usecase}
\subsection{Intermediate ANR usecase}
After the general functionality of the LMS algorithm has been verified with the above simple and artificial usecases, a more complex and intermediate scenario is now introduced. In this usecase, a real-world audio track of a person speaking on TV (see top graph in Figure \ref{fig:fig_plot_1_wav.png}) is used as the clean target signal, which is then corrupted with a dominant breathing noise as the noise signal. This scenario represents a more realistic application of the LMS algorithm, as it involves complex audio signals with varying frequency components and relatively high dynamics, but still keeps the advantage of having the clean signal available for performance evaluation. Also, again, the same noise which corrputs the target signal is used as the reference noise signal, as no transfer functionsare applied on the signals.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_1_wav.png}
\caption{Corrputed target signal, noise signal and filter output of the intermediate LMS usecase}
\caption{Corrputed target signal, noise signal and filter output of the intermediate ANR usecase}
\label{fig:fig_plot_1_wav.png}
\end{figure}
\noindent The filter output in Figure \ref{fig:fig_plot_1_wav.png} indicates already graphically, that the audio track of the person speaking is significantly more intelligible after the application of the ANR algorithm - the prominent breathing noise is clearly reduced in the filter output compared to the corrupted target signal.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_2_wav.png}
\caption{Error signal and filter coefficient evolution of the intermediate LMS usecase}
\caption{Error signal and filter coefficient evolution of the intermediate ANR usecase}
\label{fig:fig_plot_2_wav.png}
\end{figure}
\noindent The error signal in Figure \ref{fig:fig_plot_2_wav.png} confirms the function of the algorithm and shows peaks corresponding to the spikes in the breathing noise, indicating the the moments, when the LMS algorithm is setting its coeffcients again to adapt to the changing noise characteristics. It makes sense, that the adaption of the filter coefficients causes repeating spikes in the error signal, as the noise signal now is not static or periodic, but rather dynamic and changing it frequenc and amplitude over time.
\subsection{Realisitic LMS usecase}
\subsection{Complex ANR usecase}
To close the topic of high-level simulations of the ANR algorithm, a more complex and realistic usecase is finally introduced. In this scenario, the same two audio tracks of the previous usecase are used - but now they pass different transfer functions. Now, an analitical solution is not possible anymore, as the transfer functions affect the signals in different ways, making it impossible to simply subtract the noise signal from the corrupted target signal. This scenario represents a more realistic application of the ANR algorithm, as it involves complex audio signals with varying frequency components and dynamics, as well as different transfer functions affecting the signals.\\ \\
A time-varying transfer function fulfills the purpose of simulating a more realistic acoustic environment, where the signals are affected by the changing surroundings (like a noise source moving away from the microphone). In the case of a static transfer function, they represent the reality of a sensor with a specific frequency response characteristic - this case is especially important, as later a fixed set of filter coefficients shall take care of the predictable part of the signal to reduce the computing power of the DSP.\\
Therefor, the audio tracks from the previous example are now convolved with different transfer functions, which mimic the case, that the breathing noise moving away from the microphone, while the microphoe, which records the corrputed target signal, shows another frequency response characteristic. This means, that the reference noise signal is now different to the noise signal corrupting the target signal, making adaptive noise reduction the only feasible approach to reduce the noise from the target signal.\\ \\
Different transfer functions represent the reality of different microphones recording the corrupted target signal and the reference noise signal with a specific frequency response characteristic - this circumstance is especially important, as later a fixed set of filter coefficients shall take care of the predictable part of the signal to reduce the computing power of the DSP.\\
Therefore, the audio tracks from the previous example are now convolved with different transfer functions, which mimic the case, that the microphone recording the corrputed target signal, shows another frequency response characteristic as the one recording the reference noise signal. This means, that the reference noise signal is now different to the noise signal corrupting the target signal, making adaptive noise reduction the only feasible approach to reduce the noise from the target signal.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_3_wav_complex.png}
\caption{Two different microphone sensitivities used for recording the corrupted target signal and the reference noise signal}
\label{fig:fig_plot_3_wav_complex.png}
\end{figure}
\noindent Figure \ref{fig:fig_plot_3_wav_complex.png} illustrates the sensitivity curve of two different microphones used to record the corrupted target signal and the reference noise signal respectively, resulting in two different transfer functions applied to the signals. The effect of transfer functions on the noise signal is shown in Figure \ref{fig:fig_plot_4_wav_complex.png}, where the top graph shows the raw noise signal, while the second and third graph show the effect of the two different transfer functions on the noise signal.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_4_wav_complex.png}
\caption{The raw noise signal recorded with two different microphones, showing the effect of different transfer functions on the signal}
\label{fig:fig_plot_4_wav_complex.png}
\end{figure}
\noindent To evaluate the performance of the ANR algorithm in this complex scenario, the corrupted target signal is recorded with microphone 1 while the reference noise signal is recorded with microphone 2. The filter output in Figure \ref{fig:fig_plot_1_wav_complex.png} indicates, that the ANR algorithm is still capable of significantly reducing the noise from the corrupted target signal, even with only a different reference noise signal available to adapt the filter coefficients.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_1_wav_complex.png}
\caption{Corrputed target signal, noise signal and filter output of the complex ANR usecase}
\label{fig:fig_plot_1_wav_complex.png}
\end{figure}
\noindent The error signal in Figure \ref{fig:fig_plot_2_wav_complex.png} shows only a minor increase in amplitude compared to the previous intermediate usecase, indicating that the ANR algorithm is effectively adapting its filter coefficients.
\begin{figure}[H]
\centering
\includegraphics[width=1.0\linewidth]{Bilder/fig_plot_2_wav_complex.png}
\caption{Error signal and filter coefficient evolution of the complex ANR usecase}
\label{fig:fig_plot_2_wav_complex.png}
\end{figure}
As now the functionality of the ANR algorithm has been verified in different scenarios, varying from simple to complex, the next chapter of this thesis focuses on the implementation of the algorithm on the low-power DSP.

View File

@@ -1,11 +1,11 @@
\relax
\@writefile{toc}{\contentsline {section}{\numberline {4}Hardware setup and low level simulations}{35}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Description of the low-power DSP}{35}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Implementation of the ANR algorithm on the DSP}{36}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}First optimization approach: algorithm implementation}{36}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Second optimization approach: hybrid ANR algorithm}{36}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}Hardware setup and low level simulations}{38}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Description of the low-power DSP}{38}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Implementation of the ANR algorithm on the DSP}{39}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}First optimization approach: algorithm implementation}{39}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Second optimization approach: hybrid ANR algorithm}{39}{}\protected@file@percent }
\@setckpt{chapter_04}{
\setcounter{page}{37}
\setcounter{page}{40}
\setcounter{equation}{21}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
@@ -19,7 +19,7 @@
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{figure}{27}
\setcounter{figure}{31}
\setcounter{table}{0}
\setcounter{float@type}{16}
\setcounter{tabx@nest}{0}
@@ -140,7 +140,7 @@
\setcounter{lstnumber}{21}
\setcounter{FancyVerbLine}{0}
\setcounter{linenumber}{1}
\setcounter{LN@truepage}{36}
\setcounter{LN@truepage}{39}
\setcounter{FancyVerbWriteLine}{0}
\setcounter{FancyVerbBufferLine}{0}
\setcounter{FV@TrueTabGroupLevel}{0}