Python wrapper of APM simulators (e.g., audioproc_f
) with which quality assessment can be automatized. The tool allows to simulate different noise conditions, input signals, APM configurations and it computes different scores. Once the scores are computed, the results can be easily exported to an HTML page which allows to listen to the APM input and output signals and also the reference one used for evaluation.
virtualenv
$ sudo apt-get install python-virtualenv
my_env
)$ cd ~ && virtualenv my_env
$ source ~/my_env/bin/activate
pip
(my_env)$ pip install enum34 numpy pydub scipy pandas pyquery jsmin \
csscompressor
out/Default/py_quality_assessment
and check that apm_quality_assessment.py
existsout/Default/py_quality_assessment
python -m unittest discover -p "*_unittest.py"
POLQA_PATH
environment variable$ export POLQA_PATH=/var/opt/PolqaOem64
AECHEN_IR_DATABASE_PATH
environment variable$ export AECHEN_IR_DATABASE_PATH=/var/opt/AIR_1_4
out/Default/py_quality_assessment/probing_signals
(*1)out/Default/py_quality_assessment/noise_tracks
(*1, *2)(*1) You can use custom files as long as they are mono tracks sampled at 48kHz encoded in the 16 bit signed format (it is recommended that the tracks are converted and exported with Audacity).
out/Default/py_quality_assessment
apm_quality_assessment.sh
as an example script to parallelize the experimentsapm_quality_assessment.sh
Showing all the results at once can be confusing. You therefore may want to export separate reports. In this case, you can use the apm_quality_assessment_export.py
script as follows:
--output_dir, -o
to the same value used in apm_quality_assessment.sh
--config_names, -c
--capture_names, -i
--render_names, -r
--echo_simulator_names, -e
--test_data_generators, -t
--eval_scores, -s
-f <suffix>
For instance:
$ ./apm_quality_assessment_export.py \ -o output/ \ -c "(^default$)|(.*AE.*)" \ -t \(white_noise\) \ -s \(polqa\) \ -f echo
After generating stats, it can help to visualize how a score depends on a certain APM simulator parameter. The apm_quality_assessment_boxplot.py
script helps with that, producing plots similar to this one.
Suppose some scores come from running the APM simulator audioproc_f
with or without the level controller: --lc=1
or --lc=0
. Then two boxplots side by side can be generated with
$ ./apm_quality_assessment_boxplot.py \ -o /path/to/output -v <score_name> -n /path/to/dir/with/apm_configs -z lc
The input wav file must be:
audioproc_f
)Depending on the license, the POLQA tool may take “breaks” as a way to limit the throughput. When this happens, the APM Quality Assessment tool is slowed down. For more details about this limitation, check Section 10.9.1 in the POLQA manual v.1.18.
In case of issues with the POLQA score computation, check py_quality_assessment/eval_scores.py
and adapt PolqaScore._parse_output_file()
. The code can be also fixed directly into the build directory (namely, out/Default/py_quality_assessment/eval_scores.py
).