EAPUG
EAPUG
EAPUG
Contents
Chapter 1 Introduction........................................................................................... 5
Chapter 3 Terminology.......................................................................................... 7
5.4.1 Description................................................................................................................................ 27
5.4.2 Definition C code.......................................................................................................................28
5.5 Volume control.........................................................................................................................28
5.5.1 Description................................................................................................................................ 28
5.5.2 Definition C code.......................................................................................................................29
5.6 Bass enhancement..................................................................................................................29
5.6.1 Description................................................................................................................................ 29
5.6.2 Definition C code.......................................................................................................................29
5.7 Audio volume leveler............................................................................................................... 30
5.7.1 Description................................................................................................................................ 30
5.7.2 Definition C code.......................................................................................................................30
5.8 Loudness maximizer................................................................................................................30
5.8.1 Description................................................................................................................................ 30
5.8.1.1 Effect level................................................................................................................................... 30
5.8.1.2 Gain............................................................................................................................................. 30
5.8.1.3 Attenuation...................................................................................................................................31
5.8.1.4 Speaker cut-off.............................................................................................................................31
5.8.2 Definition C code.......................................................................................................................31
5.9 Treble enhancement................................................................................................................31
5.9.1 Description................................................................................................................................ 31
5.9.2 Definition C code.......................................................................................................................32
5.10 Peak limiter............................................................................................................................32
5.10.1 Description.............................................................................................................................. 32
5.10.2 Definition C code.....................................................................................................................32
5.11 RMS limiter............................................................................................................................ 32
5.11.1 Description.............................................................................................................................. 33
5.11.2 Definition C code.....................................................................................................................33
5.12 Parametric spectrum analyzer...............................................................................................33
5.12.1 Description.............................................................................................................................. 33
5.12.2 Definition C code.....................................................................................................................33
5.13 Crossover two-bands.............................................................................................................33
5.13.1 Description.............................................................................................................................. 33
5.13.2 Definition C code.....................................................................................................................34
5.14 Headroom management........................................................................................................35
5.14.1 Headroom computation...........................................................................................................35
5.14.2 API.......................................................................................................................................... 35
5.14.3 Operating mode...................................................................................................................... 35
5.14.3.1 Definition C code........................................................................................................................35
5.14.4 Band definition........................................................................................................................ 35
5.14.4.1 Definition C code........................................................................................................................35
5.14.5 Configuration example............................................................................................................ 36
5.14.5.1 Example 1.................................................................................................................................. 36
5.14.5.2 Example 2.................................................................................................................................. 36
5.14.5.2.1 Without the equalizer.................................................................................................. 37
5.14.5.2.2 With the equalizer....................................................................................................... 37
5.14.6 Conclusion.............................................................................................................................. 38
6.2.5 LVM_GetHeadroomParams...................................................................................................... 41
6.2.6 LVM_GetSpectrum....................................................................................................................41
6.2.7 LVM_SetVolumeNoSmoothing..................................................................................................41
6.3 Memory placement.................................................................................................................. 42
Chapter 1
Introduction
This application note provides the required information to understand, deploy, and tune the Essential Audio Processing
(EAP) library.
For each processing block, this document provides:
• A description of the behavior.
• A description of the tuning parameters to perform classic tuning.
An additional chapter EAP integration explains how to perform the integration of EAP into an existing application.
Chapter 2
Audio tuning
Audio tuning is an important aspect of application development and must be considered. It permits to adapt the algorithm to your
audio chain and your speaker, including the casing speaker.
EAP is provided with the Audio Tuning Tool to exercise the algorithms. However, you must plan tuning sessions with the
actual hardware.
®
Classic audio tuning is simple, and it is possible to produce good results with little audio processing knowledge and NXP support.
If expert audio tuning is required to reach better acoustic experience, then you need:
• An audio laboratory to be able to perform dedicated measures.
• An acoustic engineer to understand and reproduce the tuning procedure.
NXP can organize a tuning session with your device in its certified audio laboratory with an acoustic engineer who supports the
EAP block, see Figure 1.
Chapter 3
Terminology
Figure 2 shows an overview of several terms that are used throughout this document.
Noise floor
Dynamix range
Digital Audio
samples
Figure 2. Terminology
Chapter 4
Acronyms and abbreviations
Table 1 list all the acronyms and abbreviations used in the document.
Acronym Definition
BE Bass Enhancement; either Pure Bass or DBE which ever is included in the bundle release
Frame Duration The duration of a sample buffer (in seconds) is given by the frame size and divided by the sample rate
Frame Size The number of samples per channel to be processed in one call to the LVM_Process function
The name for processing data where the input and output buffers are at the same physical address
Inplace
in memory
The arrangement of samples in memory where the samples are alternately for the Left channel and the
Interleaved
Right channel
LM Loudness Maximizer
Non-Interleaved The arrangement of samples in memory where the samples for each channel follow one another
The name for processing data where the input and output buffers are at different physical addresses
Outplace
in memory
PB Pure Bass
Acronym Definition
TE Treble Enhancement
TG Tone Generator
VC Volume Control
XO Crossover
Chapter 5
EAP description
This section includes audio block descriptions and tuning information.
5.1 General
5.1.1 Overview
The EAP software is a bundle of audio processing blocks which can be ordered as required at library compilation time. Then the
EAP software can be placed anywhere in the audio chain after the audio decoder and before the output driver.
EAP supports "Mono" or "Stereo" raw audio data in 16-bits, 24-bits, and 32-bits at multiple sample rate 8000 Hz, 11025 Hz, 12000
Hz, 16000 Hz, 22050 Hz, 24000 Hz, 32000 Hz, 44100 Hz, 48000 Hz or 96000 Hz.
EAP includes the following sound processing algorithms:
• 3D Virtualization: ConcertSound
• Speaker Equalizer
• User Equalizer
• Bass Enhancement (Pure Bass or Digital Bass Enhancement)
• Volume Control
• Treble Enhancement
• Loudness Maximizer
• Auto Volume Leveler
• Tone Generator
• Peak Limiter
• RMS Limiter
• Parametric Spectrum Analyzer
• Crossover two-bands
For details, see Figure 3.
CHANNEL HANDLE
BASS TREBLE
Mono or Stereo
ENHANCEMENT ENHANCEMENT
InPlace or OutPlace Buffering
SPEAKER USER
PARAMETRIC PARAMETRIC CROSSOVER
VOLUME CONTROL EQUALIZER EQUALIZER
AUTOMATIC 3D EFFECT
PEAK RMS SPECTRUM
VOLUME Stereo, Cinema,
LIMITER LIMITER VISUALIZER
LEVEL Concert, Music
NXP Technology Dynamic Process Block Static Process Block Stereo /16-bits / up to 48 kHz
The process can be performed in-place (input and output buffer are same) or with separate input and output buffer. Parameters
update can happen at any time, EAP saves them and apply them.
This combination of audio features results in an impressive effect that enhances the tonal perception of the sound and improves
the "spatialness" of the audio, resulting in an enjoyable and relaxing listening experience.
EAP audio blocks can be reordered if necessary (Contact NXP Semiconductors for new library generation). For default and
recommended audio chain order, see Figure 4.
Input RMS
reference
measure
Automatic Loudness
User Parametric Bass Treble
Volume Maximiser
Equalizer Enhancement enhancement
Level (Compressor)
See dedicated enum definition in LVM.h for correct syntax of each operating mode.
5.1.3.1 Description
This section describes the sample rate of the input audio. It can be one of the following values:
• Normal sample rates: 32 kHz, 44.1 kHz, and 48 kHz
NOTE
The x.y.z of 16-bits or 32-bits library are not linked.
Table 2. Algorithm compiled within the library depending on the feature pack
Speaker Equalizer X X
User Equalizer X X
Bass Enhancement X X
Volume Control X X
Treble Enhancement X X
Loudness Maximizer X X
Tone Generator X X
Peak Limiter X X
Table 2. Algorithm compiled within the library depending on the feature pack (continued)
RMS Limiter X X
NOTE
The high band (24 kHz to 48 kHz) is not processed by the bundle of algorithm.
It only:
• Get a delay to stay synchronized with the low band.
• Receive a gain to keep same amplitude as in the low band.
Show the processing parts.
CHANNEL HANDLE
BASS
SPECTRAL ENHANCEMENT
Fs: 48 kHz
Fs:96 kHz
DIRECT USER LOUDNESS
Fs:96 kHz
CONTROL MAXIMIZER
Volume and Balance (Compressor) SOUND EFFECT ANALYSIS
AUTOMATIC 3D EFFECT
PEAK RMS SPECTRUM
VOLUME Stereo, Cinema,
LIMITER LIMITER VISUALIZER
LEVEL Concert, Music
NXP Technology Dynamic Process Block Static Process Block Stereo /16-bits / up to 48 kHz
This is the users code responsibility to adapt audio sample input and output to the container used by the library (16-bits or 32-bits).
5.1.8.1 Description
The LVM_Format_en enumerated type is used to set the value of the bundle data format. The bundle supports input data in
two formats:
• Mono
Or
• Stereo
For an input buffer of sample number (N sample pairs for "Stereo" or N samples for "Mono"), the format of data in the In / Out buffer
depends on your configuration. There are three cases:
1. Crossover disable
2. Crossover enabled, and the input / output are in "Mono"
3. Crossover enabled, and the input / output are in "Stereo"
“ “ “
“ “ “
“ “ Not Used
“ “ Not Used
Table 4. Audio buffer format when the crossover is enabled and the input / output are in "Mono"
Mono
“ “ “ “
“ “ “ “
Mono LB Mono HB
N-2 Mono(N-2)
(N-2) (N-2)
Mono LB Mono HB
N-1 Mono(N-1)
(N-1) (N-1)
For Low Band (LB) and High Band (HB), see Crossover two-bands.
Table 5. Audio buffer format when the crossover is enabled and input / output are in "Stereo"
Stereo
“ “ “ “
“ “ “ “
Left LB Left HB
N-2 Left (N/2-1)
(N/2-1) (N/2-1)
Right LB Right HB
N-1 Right (N/2-1)
(N/2-1) (N/2-1)
Left LB Left HB
N+2 Left(N/2+1)
(N/2+1) (N/2+1)
Right LB Right HB
N+3 Right(N/2+1)
(N/2+1) (N/2+1)
“ “ “ “
“ “ “ “
Left LB Left HB
2*N-2 Left(N-1)
(N-1) (N-1)
Right LB Right HB
2*N-1 Right(N-1)
(N-1) (N-1)
For Low Band (LB) and High Band (HB), see Crossover two-bands.
LVM_MONOINSTEREO permits to read a "Mono" file and give the output of a "Stereo" file.
5.1.9.1 Description
The output device may be headphones or speakers. If it is a speaker, three speaker types (small, medium, or large) can be
selected. The speaker type is only used by the 3D Virtualizer if the processing block is enabled.
The low 3 dB frequency can be estimated by looking at the frequency response of the loudspeaker when mounted in the target
device and finding the frequency at which the output is approximately 3 dB below the plateau. This frequency may be different
from the one which measured on the speaker when it is not mounted in the target device.
2. The synchronous audio interface transmitter (SAI TX) module must be enabled when LVM_getInstanceHandle function
is called during the EAP initialization phase.
If software protection test failed, then the LVM_getInstanceHandle function returns LVM_INVALIDNXPPLATFORM.
If SAI TX is no more needed by the software, then it can be disabled after the LVM_getInstanceHandle() call.
5.2.1 Description
The tone generator can be configured to create fixed frequency tones and various frequency and amplitude sweeps. This
algorithm is made available on request while compiling the library for use during development to help with tuning the music
algorithms and to aid measurement of the system audio output quality.
The tone generator module is not used during music playback and it is not intended to be included as part of the final release
version of the library.
The tone generator may be used during tuning to help with measuring the audio quality of the system under development. The
tone is generated inside the bundle before any of the other algorithms are applied. In general, all other algorithms must be disabled
when the tone generator is in use.
The sweep can be either linear or logarithmic. If logarithmic sweep is selected, the rate of frequency update is based on the ratio of
the stop and start frequencies. The graph in Figure 6 shows the linear sweep output and a logarithmic sweep output for a high ratio
of stop frequency to start frequency. Linear sweep must be used when the ratio of the start and stop frequencies is close to unity.
Stop
Frequency
Output
Frequency Linear
sweep
Logarithmic
sweep
Start
Frequency
Sweep Start Time Sweep End
Params.TG_OperatingMode = LVM_TG_CONTINUOUS;
Params.TG_SweepMode = LVM_TG_SWEEPLIN;
Params.TG_StartFrequency = RequiredFrequency;
Params.TG_StartAmplitude = RequiredAmplitude;
Params.TG_StopFrequency = Params.TG_StartFrequency;
Params.TG_StopAmplitude = Params.TG_StartAmplitude;
Params.TG_SweepDuration = 0;
Params.pTG_CallBack = LVM_NULL; /* No callback */
Where:
• The RequiredFrequency is the tone frequency in Hz.
• The RequiredAmplitude is the tone output level in dBr, for example, relative to the maximum peak signal level. The 0dBr is
the maximum amplitude.
• No callback function can be used in this mode as the tone never ends.
Params.TG_OperatingMode = LVM_TG_ONESHOT;
Params.TG_SweepMode = LVM_TG_SWEEPLIN;
Params.TG_StartFrequency = RequiredFrequency;
Params.TG_StartAmplitude = RequiredAmplitude;
Params.TG_StopFrequency = Params.TG_StartFrequency;
Params.TG_StopAmplitude = Params.TG_StartAmplitude;
Params.TG_SweepDuration = RequiredDuration;
Params.pTG_CallBack = LVM_NULL; /* No callback */
Where:
• The RequiredFrequency is the tone frequency in Hz.
• The RequiredAmplitude is the tone output level in dBr, for example, relative to the maximum peak signal level. The 0 dBr is
the maximum amplitude.
• The RequiredDuration is the duration of the tone in seconds.
• At the end of the tone, the tone generator is automatically placed in LVM_TG_OFF mode, and its output is disabled. A callback
function can be used; this is called at the end of the tone.
Frequency sweep:
To generate a frequency sweep, the following parameters must be set:
Params.TG_OperatingMode = LVM_TG_ONESHOT;
Params.TG_SweepMode = LVM_TG_SWEEPLOG;
Params.TG_StartFrequency = RequiredStartFrequency;
Params.TG_StartAmplitude = RequiredAmplitude;
Params.TG_StopFrequency = RequiredStopFrequency;
Params.TG_StopAmplitude = Params.TG_StartAmplitude;
Params.TG_SweepDuration = RequiredDuration;
Params.pTG_CallBack = LVM_NULL; /* No callback */
Where:
• The RequiredStartFrequency is the initial tone frequency in Hz.
• The RequiredAmplitude is the tone output level in dBr, for example, relative to the maximum peak signal level. The 0dBr is
the maximum amplitude.
• The RequiredStopFrequency is the final tone frequency in Hz.
• The RequiredDuration is the duration of the tone in seconds.
• At the end of the tone, the tone generator is automatically placed in LVM_TG_OFF mode and its output disabled. A callback
function can be used; this is called at the end of the tone.
Amplitude sweep:
To generate an amplitude sweep, the following parameters must be set:
Params.TG_OperatingMode = LVM_TG_ONESHOT;
Params.TG_SweepMode = LVM_TG_SWEEPLIN;
Params.TG_StartFrequency = RequiredFrequency;
Params.TG_StartAmplitude = RequiredStartAmplitude;
Params.TG_StopFrequency = Params.TG_StartFrequency;
Params.TG_StopAmplitude = RequiredStopAmplitude;
Params.TG_SweepDuration = RequiredDuration;
Params.pTG_CallBack = LVM_NULL; /* No callback */
Where:
• The RequiredFrequency is the tone frequency in Hz.
• The RequiredStartAmplitude is the initial tone output level in dBr, for example, relative to the maximum peak signal level.
The 0 dBr is the maximum amplitude.
• The RequiredStopAmplitude is the final tone output level in dBr.
• The RequiredDuration is the duration of the tone in seconds.
• At the end of the tone, the tone generator is automatically placed in LVM_TG_OFF mode and its output disabled. A callback
function can be used; this is called at the end of the tone.
Params.TG_OperatingMode = LVM_TG_CONTINUOUS;
Params.TG_SweepMode = LVM_TG_SWEEPLIN;
Params.TG_StartFrequency = RequiredFrequency;
Params.TG_StartAmplitude = RequiredStartAmplitude;
Params.TG_StopFrequency = Params.TG_StartFrequency;
Params.TG_StopAmplitude = RequiredStopAmplitude;
Params.TG_SweepDuration = RequiredDuration;
Params.pTG_CallBack = LVM_NULL; /* No callback */
Where:
The RequiredFrequency is the tone frequency in Hz.
The RequiredStartAmplitude is the initial tone output level in dBr, for example, relative to the maximum peak signal level. The
0 dBr is the maximum amplitude.
The RequiredStopAmplitude is the final tone output level in dBr.
The RequiredDuration is the duration of the tone in seconds.
No callback function can be used in this mode as the tone never ends.
5.3.1 Description
This audio process is a Nband equalizer plus a low-pass and high-pass filter.
Two parametric equalizers are present in the bundle:
The user parametric equalizer:
• This equalizer is used to provide frequency effect like voice enhancement, bass boost, pop, or other equalizer.
The speaker parametric equalizer:
• This equalizer is used to control the speaker or headphone output, which can be adjusted through equalization. This allows
imperfections in the headphone or speaker and housing design of the device to be reduced.
• This gives a better overall sound quality from the device.
• This audio process is a Nband equalizer plus a high-pass filter.
5.3.1.1 N-Bands
The N-Band equalizer algorithm can be used to provide signal equalization using up to 15 bands.
Each band is defined by:
• Its center frequency, controlled in 1 Hz step.
• The gain, controlled over the range –15 dB to +15 dB in 1 dB steps for the user parametric equalizer.
• The gain, controlled over the range –15 dB to +3 dB in 1 dB steps for the speaker parametric equalizer. It is advice not to
set positive gain to avoid any digital saturation in the band.
• The Q factor, controlled over the range 0.25 to 12.00 in steps of 0.01. For details, see Figure 8 and Figure 9.
Why a different gain range?
• The user parametric equalizer works with headroom management block to avoid saturations. It controls the maximal
allowed volume control settings to guarantee an acceptable risk of saturations over the band definition. With this
approach, it is allowed to set band gain superior to 0 dB.
• The speaker parametric equalizer does not get any mechanism to avoid saturation. This is why it is recommended staying
below 0 dB gain. +3 dB gain per band can be partially set in a limited band frequency with acceptable risk of saturations.
Each band has three parameters:
• Gain: the gain of the band in 1 dB step.
• Frequency: If the gain is set to 0 dB, then the band is disabled, the frequency is in Hz, from 20 Hz to Nyquist frequency (half
the sample rate).
• Q-factor: the filter Q, from 0.25 to 12.00 in steps of 0.01.
NOTE
The desired Q value is the parameter value divided by 100. So, if setting Q is equals to 0.25, then the input value
is 25.
Where:
— Fc - Filter center frequency (the Frequency setting).
— Flow3dB - The lower 3 dB cut-off frequency of the filter.
— Fhigh3dB - The upper 3 dB cut-off frequency of the filter.
For details, see Figure 7.
Peak
3 dB
Flow3dB Fc Fhigh3dB
#define MAX_BANDS 15
-15dB_1
-10dB_1
-10
-5dB_1
0dB_1
5dB_1
-15
10dB_1
Amplitude in dB
15dB_1
-20
-25
-30
-35
1 2 3 4 5
10 10 10 10 10
Frequency in Hz
-16
-18
-20
-22
1 2 3 4 5
10 10 10 10 10
Frequency in Hz
The filters used in the equalizer include a user-defined center or corner frequency. If this frequency is greater than Nyquist (half of
the sample rate), then the filter is automatically disabled. Hence, the filter definitions do not need to be modified when changing
the sample rate.
Minimum frequency 20 Hz 1 Hz
dB / Octave 12 dB 6 dB
If the corner frequency of the high-pass filter is above the Nyquist, then the filter is automatically disabled in the equalizer.
2 205 Hz 0.96
3 837 Hz 0.96
4 3427 Hz 0.96
5 14027 Hz 0.96
Band
Preset name
#1 #2 #3 #4 #5
Normal 3 0 0 0 3
Bass Booster 6 3 1 0 0
Classical 5 3 -2 4 4
Dance 8 2 4 6 3
Flat 0 0 0 0 0
Folk 6 3 3 5 2
Heavy Metal 4 1 9 3 0
Hip Hop 5 3 0 1 3
Jazz 4 2 -2 2 5
Piano 3 2 3 5 4
Pop -1 2 5 1 -2
Rock 5 3 -1 3 5
Spoken Word -2 2 5 5 2
Symphony 7 0 -2 -4 3
Theater 3 0 5 -1 2
Treble Booster 0 0 2 4 6
Band
Preset name
#1 #2 #3 #4 #5
Latin 4 0 -2 1 5
Vocal Booster -4 2 5 3 -1
Bass Reducer -6 -4 0 0 0
Treble Reducer 0 0 -1 -4 -7
5.4 3D widening
5.4.1 Description
The Concert Sound audio effect increases the perceived distance and depth of the audio, providing an enhanced
listening experience.
With headphones, it offers highly effective sound enrichment. These algorithms reproduce audio with the frequency balance
intended in the studio, creating a natural sound field outside the listener’s head. It works on all types of music and film sound tracks
in "Mono" or "Stereo" formats.
With closely spaced loudspeakers, it provides a sound with widened "Stereo" (also sometimes called 3D widening). It works on
music and film sound tracks and leaves the voice natural.
The cinema and concert sound algorithms digitally process the music signal on an audio device’s sound processor using
HRTF (Head-Related Transfer Function) positioning data. This accentuates inter-aural differences, increases the perceived
distance and depth of the sound, and recreates natural crosstalk between the ears. Such elements are lost with conventional
headphone playback.
5.5.1 Description
The volume control is a permanent feature of the EAP solution.
The volume is adjustable from 0 dB (full volume) to –96 dB (silence) in 1 dB steps. This is a soft volume control; it smoothly changes
from one volume setting to another.
The volume control is split in two parts:
• Pre volume control is located at the front end and permits to create headroom for the following process.
• Post volume control is located at the back end of the chain to apply standard volume after the process.
The repartition of the volume in pre volume and post volume is automatic and follows the rule:
For general volume = 0 dB to -15 dB:
• Pre volume = General volume
• Post Volume = 0 dB
For general volume = -15 dB to -96 dB:
• Pre volume =-15 dB
• Post volume = general volume – 15 dB
5.6.1 Description
Two different bass enhancement algorithms can be delivered within the software bundle:
• Dynamic Bass Enhancement (DBE) – the algorithm exploits the acoustics system characteristics and aims to enhance the
bass sensation in the target system by maximizing the bass enhancement within the available headroom.
• Pure Bass (PB) – this second bass enhancement option differs from the Dynamic Bass Enhancement in such a way that
it can also deliver a bass enhancement for input signals at full range level. For this product implementation, a unique
®
patented NXP technology is used that makes sure a deep and rich bass enhancement is delivered without any distortion
to the audio and without the need to take any acoustical headroom on the input signal even with full-scale input signals.
NOTE
DBE or PB is chosen at library compilation time.
5.7.1 Description
The volume level may require readjustment for each song when selecting music from various sources and artists. This is because
the volume setting defined for the previous song is either too low or too high for the next song.
The auto volume leveler overcomes this problem in music players. It automatically adjusts the volume for each track to maintain
the desired output volume level. It removes the need to adjust the volume for each track.
The typical use cases are:
• Having a constant volume between different music tracks.
• Minimize the higher volume of advertisements.
• Increase the volume of low-level soundtrack part. Some details may become audible.
5.8.1 Description
The loudness maximizer significantly increases the perceived output volume for all types of music. It is intended for use when the
output volume is already set to maximum.
It works with all speaker types from small to large but it is effective with small speakers where the maximum output volume is
typically very low.
The loudness maximizer should only be used once the system volume control is already at its maximal undistorted level, it should
be disabled otherwise.
With high-level input signals, there is still an output volume increase but at the expense of linearity.
If the processing before or after the bundle includes a compressor or other non-linear processing, the combination with the
loudness maximizer can create some unexpected audio effects. Other compressor or non-linear processing blocks should be
disabled when the loudness maximizer is enabled.
5.8.1.2 Gain
It represents the target gain of the compressor.
Higher is the gain, the more volume increase effect is perceptible, but more non-linearity is present.
5.8.1.3 Attenuation
If input data already gets non-linearity, adding the LM generates unacceptable distortion.
In these cases, the only solution is to reduce the general output gain of the LM by the attenuation parameter.
Small 750 Hz
Medium 500 Hz
5.9.1 Description
The treble enhancement algorithm adds more brilliance to the sound. It applies a filter to amplify the higher audio frequencies.
Two operating modes are available:
• In the normal mode, an adjustable treble enhancement effect is used. This requires extra Million Instructions Per Seconds
(MIPS) to operate. The amount of boost is set in 15 levels of 1 dB steps. The effect has a corner frequency of 8 kHz and
so no boost can be applied at sample rates of 16 kHz or less.
• In the MIPS-saving mode, the bundle applies a fix curve going up to 6 dB of treble enhancement without additional MIPS.
For the frequency response of the treble boost at different gain settings for a signal of –20 dB input level, see Figure 10.
-6 0dB
A 3dB
m -8 6dB
p 9dB
L
12dB
i -10
t 15dB
u -12
d
e
-14
i
n -16
d
B -18
-20
-22 1 2 3 4 5
10 10 10 10 10
Frequency in Hz
LVM_INT16 TE_EffectLevel;
// Treble Enhancement gain in dB (0 to 15) or LVM_TE_LOW_MIPS for saving MIPS
5.10.1 Description
The peak limiter permits to limit the peak amplitude of the processed signal.
It keeps audio signal amplitude below a threshold parameter value relative to 0 dBFS. The algorithm includes a look-ahead buffer
to guarantee a low distortion level at output.
It can be used for acoustic feeling purpose or material protection (for example, protection of small a speaker).
5.11.1 Description
The Root Mean Square (RMS) limiter permits to limit the average RMS value of the processed signal.
The RMS value used by EAP is the average RMS power (FS square wave) with a window width equal to the block size.
It keeps RMS audio signal value below a threshold parameter relative to a reference. Reference can be 0 dBFS or the input
average RMS power of the signal.
It can be used for acoustic feeling purpose or material protection (for example, protection of a large speaker).
5.12.1 Description
The Parametric Spectrum Analyser (PSA) generates the spectral information of the output signal. This spectral information is used
for spectral display purpose.
The PSA spectral amplitude is not affected by the EAP volume control.
A user can define the number of bands and the decay rate value for each band.
5.13.1 Description
The goal of the crossover is to split the digital EAP output signal in two spectral bands. One dedicated to the low frequencies and
another one dedicated to the high frequencies. This permits to address two-way speakers for a better sound experience.
As an example:
• Crossover cut-off frequency is around 100 Hz - 250 Hz according to subwoofer spectral characteristic.
• The low-band output signal is sent to a subwoofer.
• The high-band output signal is sent to a medium speaker.
• This could provide a better sound experience than sending the full band to a medium.
For more details, see Figure 11.
High band
Subwoofer
EAP crossover cut-off frequency (Fc) is configurable from 60 Hz to 6 kHz. EAP delivers digital audio signal in two-bands:
• The low-band in range (0 – Fc)
• The high-band in range (Fc – Fs/2)
Each speaker has got its own frequency specifications. For example, a subwoofer is used to play the low frequencies only,
whereas a tweeter is used to play higher frequencies. Refer to the speaker characteristic to determine the better cut-off frequency
to be applied.
At the library API level, digital signal output low and high-bands are stored in two separate buffers. One dedicated to the low-band,
the other to the high-band. See code API description for further details.
Audio reconstruction:
The audio reconstruction (Sum = low-band + high-band) is occurring in the acoustic area. However, if we sum the low-band, and
the high-band at digital level, the EAP crossover reconstruction is almost perfect, see Figure 12.
150
Signal
Power
(dB)
130
110
band1
band2
sum
90
102 103 104
Frequency (Hz)
5.14.2 API
An API extension allows the user to control the headroom parameters and switch the management ON and OFF.
Headroom parameters may be changed at any time during processing using the LVM_SetHeadroomParameters function. They
take effect at the next LVM_Process call. LVM_GetHeadroomParameters permits to read the configuration, see Special function.
The LVM_HeadroomBandDef_t type is used for defining the headroom band characteristics.
5.14.5.1 Example 1
The headroom management settings are as follows:
Headroom_OperatingMode = LVM_HEADROOM_ON;
NHeadroomBands = 2;
pHeadroomDefinition[0].Limit_Low = 20;
pHeadroomDefinition[0].Limit_High = 4999;
pHeadroomDefinition[0].Headroom_Offset = 3;
pHeadroomDefinition[1].Limit_Low = 5000;
pHeadroomDefinition[1].Limit_High = 24000;
pHeadroomDefinition[1].Headroom_Offset = 4;
The aim here is to achieve a trade-off between the risk of saturation and good volume.
The assumption made in this definition is:
• It is possible to apply up to 3 dB of boost in the band 20 Hz to 4999 Hz without serious risk of saturation.
• It is possible to apply up to 4 dB of boost in the band 5000 Hz to 24000 Hz without serious risk of saturation.
When saturation occurs, it should not be audible under normal listening conditions.
Volume controls are limited to -3 dB or -4 dB only if the user equalizer band gain is superior to 3 dB or 4 dB in the corresponding
frequency range.
It can be default parameters for most of the device.
5.14.5.2 Example 2
In this example, we want to control the headroom of the output signal amplitude like this:
• In the first band range from 20 Hz to 999 Hz, the signal can reach full scale 0 dBFS.
• In the second band range from1000 Hz to 24000 Hz, the signal must stay below -3 dB to ensure that the saturations are
not so present.
To realize that, we configure the headroom management as follows:
HeadroomBandDef[1].Limit_Low = 1000;
HeadroomBandDef[1].Limit_High = 24000;
HeadroomBandDef[1].Headroom_Offset = -3;
/* Headroom parameters setting */
HeadroomParams.pHeadroomDefinition = &HeadroomBandDef[0];
HeadroomParams.Headroom_OperatingMode = LVM_HEADROOM_ON;
HeadroomParams.NHeadroomBands = 2;
/* Apply changes */
LVM_SetHeadroomParams(hInstance, &HeadroomParams);
NOTE
If this rule were applied only above 1 kHz, it would introduce attenuation at higher frequencies, changing the tonal
characteristics of the music.
5.14.6 Conclusion
To control the amount of potential saturation, the maximum volumes are reduced.
While tuning phase, the headroom manager permits to deal between a number of acceptable saturations at the maximum level,
and the maximal level allowed at the user equalizer gain.
The headroom manager adapts automatically the maximal volume gain allowed for an equalization parameters setting.
Chapter 6
EAP integration
This chapter illustrates an application code example which is distributed with the EAP library.
An example application is provided in the release to show classical integration of the EAP, see file EAP_ExApp.c.
The parameters may also be updated after initialization. This procedure may be used at any time while running the algorithm, see
Figure 14:
Call LVM_GetControlParameters
function
6.2.1 LVM_GetVersionInfo
This function is used to retrieve information about the library's version.
6.2.2 LVM_ClearAudioBuffers
This function is used to clear the internal audio buffers of the bundle.
6.2.3 LVM_GetAVLGain
This function is used to retrieve the AVL last generated gain.
6.2.4 LVM_SetHeadroomParams
Available only if the library is compiled with an equalizer block. This function is used to set the headroom management parameters.
6.2.5 LVM_GetHeadroomParams
Available only if the library is compiled with an equalizer block. This function is used to get the headroom management parameters.
6.2.6 LVM_GetSpectrum
Available only if the library is compiled with PSA block. This function is used to retrieve spectral information at a given audio time
for display usage.
6.2.7 LVM_SetVolumeNoSmoothing
This function is used to set output volume without any smoothing.
LVM_PERSISTENT_SLOW_DATA
LVM_PERSISTENT_FAST_DATA
LVM_PERSISTENT_FAST_COEF
Chapter 7
MIPS and Memory
Million Instructions Per Seconds (MIPS) measured on the SDK platform with the SEGGER system view tool, see Table 9 and
Table 10. According to available resource, for EAP on the final product, you can disable some algorithms to save MIPS.
NOTE
All EAP algorithms cannot be enabled at the same time on an LPC55 platform.
Memory size is compilation-dependent and cannot be adjustable by enabling or disabling the algorithm.
HIFI4 Application - - -
code only (No
EAP library)
Chapter 8
Revision history
Table 11 summarizes the changes done to this document since the initial release.
Right to make changes - NXP Semiconductors reserves the right to make changes to information published in this document, including
without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all
information supplied prior to the publication hereof.
Security — Customer understands that all NXP products may be subject to unidentified or documented vulnerabilities. Customer
is responsible for the design and operation of its applications and products throughout their lifecycles to reduce the effect of these
vulnerabilities on customer’s applications and products. Customer’s responsibility also extends to other open and/or proprietary
technologies supported by NXP products for use in customer’s applications. NXP accepts no liability for any vulnerability. Customer
should regularly check security updates from NXP and follow up appropriately. Customer shall select products with security features
that best meet rules, regulations, and standards of the intended application and make the ultimate design decisions regarding its
products and is solely responsible for compliance with all legal, regulatory, and security related requirements concerning its products,
regardless of any information or support that may be provided by NXP. NXP has a Product Security Incident Response Team
(PSIRT) (reachable at PSIRT@nxp.com) that manages the investigation, reporting, and solution release to security vulnerabilities of
NXP products.
NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, COOLFLUX,EMBRACE, GREENCHIP, HITAG,
ICODE, JCOP, LIFE, VIBES, MIFARE, MIFARE CLASSIC, MIFARE DESFire, MIFARE PLUS, MIFARE FLEX, MANTIS, MIFARE
ULTRALIGHT, MIFARE4MOBILE, MIGLO, NTAG, ROADLINK, SMARTLX, SMARTMX, STARPLUG, TOPFET, TRENCHMOS,
UCODE, Freescale, the Freescale logo, AltiVec, CodeWarrior, ColdFire, ColdFire+, the Energy Efficient Solutions logo, Kinetis,
Layerscape, MagniV, mobileGT, PEG, PowerQUICC, Processor Expert, QorIQ, QorIQ Qonverge, SafeAssure, the SafeAssure logo,
StarCore, Symphony, VortiQa, Vybrid, Airfast, BeeKit, BeeStack, CoreNet, Flexis, MXC, Platform in a Package, QUICC Engine, Tower,
TurboLink, EdgeScale, EdgeLock, eIQ, and Immersive3D are trademarks of NXP B.V. All other product or service names are the
property of their respective owners. AMBA, Arm, Arm7, Arm7TDMI, Arm9, Arm11, Artisan, big.LITTLE, Cordio, CoreLink, CoreSight,
Cortex, DesignStart, DynamIQ, Jazelle, Keil, Mali, Mbed, Mbed Enabled, NEON, POP, RealView, SecurCore, Socrates, Thumb,
TrustZone, ULINK, ULINK2, ULINK-ME, ULINK-PLUS, ULINKpro, µVision, Versatile are trademarks or registered trademarks of Arm
Limited (or its subsidiaries) in the US and/or elsewhere. The related technology may be protected by any or all of patents, copyrights,
designs and trade secrets. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. The Power
Architecture and Power.org word marks and the Power and Power.org logos and related marks are trademarks and service marks
licensed by Power.org. M, M Mobileye and other Mobileye trademarks or logos appearing herein are trademarks of Mobileye Vision
Technologies Ltd. in the United States, the EU and/or other jurisdictions.