Commit Graph

8 Commits

Author SHA1 Message Date
Liam Girdwood 78748d42b9
Merge pull request #72 from singalsu/fix_eq_fir_length_trailing_zeros
EQ FIR: Add check and removal for trailing zeros in filter coefficients
2018-09-19 20:35:36 +01:00
Seppo Ingalsuo c43666d6f0 EQ FIR: Add check and removal for trailing zeros in filter coefficients
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>
2018-09-19 16:36:22 +03:00
Seppo Ingalsuo e3d68ecd89 EQ Tool: Output topology m4 binary control style configuration data
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>
2018-09-19 15:47:29 +03:00
Seppo Ingalsuo 206deaf457 EQ Tool: Fix compatibility with Matlab and improve accuracy of IIR filters
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>
2018-08-30 13:49:17 +03:00
Seppo Ingalsuo 085b68058b EQ: Improve example equalizer design scripts
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>
2018-08-09 17:07:55 +03:00
Seppo Ingalsuo 684737cf5d EQ: Improve Matlab compatibility of equalizer filter design plus cleanup
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>
2018-08-09 17:07:55 +03:00
Seppo Ingalsuo 5eb017512e SOFT: Add equalizer tuning scripts and small examples
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>
2018-08-07 19:05:38 +03:00
Seppo Ingalsuo b322168438 SOFT: Add SRC coefficients generate tool
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>
2018-06-04 10:06:24 +01:00