This patch adds capability to apply for capture microphone calibration
data (ASCII text lines with Hz, dB values). The calibration data file
name needs to be edited into configuration file mls_rec_config.txt. Such
calibration data is provided by several inexpensive USB measurement
microphones manufacturers.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds explicit conversion to signed int32 type for response to
channels indices in assign_response and filter coefficients. The bug was
visible if trying to activate in IIR blob the per channel filter bypass
by having a negative value (-1) in any of channel assigns. Octave assumed
the type to be unsigned and produced wrong configuration bytes.
The filter coefficients are already integer type from previous
quantization code in the conversion process. However it does not hurt to
have extra safety to avoid similar issue as assign.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds into SOFT/tune/eq a script mls_freq_resp.m that can
be used as low budget or quick developer tool to measure device frequency
response. The configuration files mls_play_config.txt and
mls_rec_config.txt configure the audio devices for local or remote
ssh aplay/arecord execution.
The MLS measurement with a short time window, e.g. less than 10 ms can
partially achieve the same as anechoic measurement. However this
is not intended to replace usage any professional audio measurement. If
using this use with care!
Note also that as such this script measures the response of a
speaker - microphone system. One response need to be known and
under calibration to get reliable results for other. Even ADC and DAC
responses may impact.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the export format to currently used format in
topology. It adds also possibility to pass text comment into line
above the bytes from EQ design script. The date is appended
automatically after comment.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds removing of extra zeros in the FIR coefficients. The
zeros can happen in some responses due to fixed point quantization of
very small values. The zero taps consume DSP resources for nothing so
better to clean them out for EQ configuration data.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds export function for the m4 syntax bytes data and adds
the export of such blob to example designs. The example EQ designs are
edited to make this format export too.
In addition the example FIR length is adjusted to be near current IPC
length maximum (384) and improve the effect quality.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes code to allocate filter poles and zeros to biquads
to allow seeing poor SNR due to strong scaling vs. available fixed point
filter word length. The issue was severe especially with Matlab version
of tf2sos() function. The replacement is straighforward z, p frequency
sort. The scaling of biquads was changed to max -6 dB instead of previous
-3 dB to be more safe against internal signal clipping.
The IIR design was changed entirely to be based on zeros and poles
(z, p, k) in intermediate storate instead of polynomial coefficients.
This improves the accuracy especially of low frequencies high-pass
designs.
The default max. IIR order is increased from 12 to 16.
Finally since the grpdelay() function in octave-signal package calculates
incorrect result the group delay computation and plotting is disabled
for now in Octave. It works in Matlab.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch cleans up the scripts and improves the accuracy of speaker
case with more carefully set manual equalizer design parameters.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds checks into places where Octave and Matlab handle
the used functions differently. In previous version the difference
in bilinear transform caused IIR designs to fail totally in Matlab.
There remains an issue with IIR EQs design with Matlab. In that case
a warning text is printed since the problem with tf2sos() does not happen
with all designs (example_spk_eq is impacted). It will be investigated
and fixed later. The problem does not happen with Octave.
Equalizer defaults had accidentally by default boost of one dB compared
to desired filter scaling. the offset (norm_offs_db) is now restored to
0.
In parametric equalizers design renamed BW to Q for the correct purpose
(peaking filter Q-value).
Fixed bug in filters normalization where loudness based scaling of IIR
filters was using calculated value for the FIR part.
Also cleaned up lot commented out lines and simplified some functions
parameters usage.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds support to SOFT to setup FIR and IIR equalizer types.
The examples scripts for simple FIR loudness effect, IIR loudness effect
and speaker equalization case demonstrate the usage of the tool. The
output ".txt" files will be possible to apply with alsactl to setup
the equalizers in SOF.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the scripts src_std_int32.m and src_tiny_int16.m those
were used to create the conversions matrices for the default and tiny
profiles. The scripts call the included src_generate function that
does the task with help from the filter design and coefficients
export utilities.
The quality and resources consumption of SRC can be customized with
this tool.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>