This commit is contained in:
Patrick Hangl
2026-02-06 13:08:46 +01:00
parent 2c8c9cdf2d
commit 80012ce7d8
6 changed files with 97 additions and 81 deletions

View File

@@ -120,8 +120,8 @@ If the \ac{ARM} core requests a sample to be processed, it activates the \ac{DSP
\caption{Flow diagram of the code implementation of the main loop and interrupt handling on the \ac{DSP} core.}
\label{fig:fig_dsp_logic.jpg}
\end{figure}
\paragraph{Calc()-function}
The calc()-function at the very end of the main process loop represents the heart of the \ac{DSP}code, as it is responsible for applying the \ac{ANR} algorithm on the two input samples. As it follows the same structure as the high-level implementation described in the previous chapter, the general functionality will not be described in detail again. The technical implementation on the \ac{DSP} however will be outlined in detail in the following subchapter, as the hardware-specific optimizations, responsible for a real-time capable implementation, are a key element for the estimation of the expectable power consumption of the system.\\ \\
\paragraph{calculate\_output()-function}
The calculate\_output()-function at the very end of the main process loop represents the heart of the \ac{DSP} code, as it is responsible for applying the \ac{ANR} algorithm on the two input samples. As it follows the same structure as the high-level implementation described in the previous chapter, the general functionality will not be described in detail again. Yet, the technical implementation on the \ac{DSP} however will be outlined in detail in the following subchapter, as the hardware-specific optimizations are key elements for the estimation of the expectable power consumption of the system.\\ \\
\subsection{DSP-level implementation of the ANR algorithm}
The ability to process audio samples in real-time on the \ac{DSP} core is strongly dependent on compiler-specific optimizations and hardware-specific implementation techniques, which allow a far more efficient execution of the algorithm compared to a native C implementation.
@@ -165,8 +165,20 @@ As already mentioned during the beginning of the current chapter, the used \ac{D
To tackle this issues, the \ac{DSP} compiler provides intrinsic functions for fractional fixed-point arithmetic, such as a fractional multiplication function, which takes two 32-bit integers as input and return an already bit-shifted 64-bit output, representing the fractional multiplication result. This approach prevents the need for manual bit-shifting operations after each multiplication.\\ \\
To support such operations, a 72-bit accumulator is provided, allowing to store intermediate 64-bit results of 32-bit multiplications without losing precision - the remaining 8 bit serve as an overflow space. If needed, a saturation function is also provided, to round the 64-bit result back to a 32-bit value.
\subsubsection{Performance evaluation and quantization of the DSP implementation}
\subsubsection{Performance quantization of the ANR calculation}
As mentioned in the previous subchapter, the \ac{ANR} calucation for every sample is executed in the calculate\_output()-function. The general scheme of the calculation was already visualized in \ref{fig:fig_anr_logic} and did not change for the implemenation in C. The main focus lies now on the computational efficiency of the different parts of the function, finally resulting in the generation of a formula, able to calculate the needed cycles in dependecy of various parameters.\\ \\
The calculate\_output() functions consists out of the following four main parts, described in detail afterwards:
\begin{itemize}
\item write\_buffer
\item apply\_fir\_filter
\item update\_output
\item update\_filter\_coefficients
\end{itemize}
Some of the sub-functions feature dsp-specific operations, resulting in a minimum count of processor cycles per input samples, depending on parameters like filter length and adaption pauses.
\paragraph{write\_buffer}
\paragraph{apply\_fir\_filter}
\subsubsection{Performance evaluation of different implementation variants}