2017-04-04 07:27:03 -07:00
|
|
|
# APM Quality Assessment tool
|
2017-02-24 05:32:21 -08:00
|
|
|
|
2017-09-27 13:22:36 +02:00
|
|
|
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.
|
2017-02-24 05:32:21 -08:00
|
|
|
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.
|
|
|
|
|
|
2017-04-04 07:27:03 -07:00
|
|
|
## Dependencies
|
|
|
|
|
- OS: Linux
|
|
|
|
|
- Python 2.7
|
2017-10-10 13:28:56 +02:00
|
|
|
- Python libraries: enum34, numpy, scipy, pydub (0.17.0+), pandas (0.20.1+),
|
|
|
|
|
pyquery (1.2+), jsmin (2.2+), csscompressor (0.9.4)
|
2017-04-05 07:25:33 -07:00
|
|
|
- It is recommended that a dedicated Python environment is used
|
|
|
|
|
- install `virtualenv`
|
|
|
|
|
- `$ sudo apt-get install python-virtualenv`
|
|
|
|
|
- setup a new Python environment (e.g., `my_env`)
|
|
|
|
|
- `$ cd ~ && virtualenv my_env`
|
|
|
|
|
- activate the new Python environment
|
|
|
|
|
- `$ source ~/my_env/bin/activate`
|
|
|
|
|
- add dependcies via `pip`
|
2017-10-10 13:28:56 +02:00
|
|
|
- `(my_env)$ pip install enum34 numpy pydub scipy pandas pyquery jsmin \`
|
|
|
|
|
`csscompressor`
|
2017-04-04 07:27:03 -07:00
|
|
|
- PolqaOem64 (see http://www.polqa.info/)
|
|
|
|
|
- Tested with POLQA Library v1.180 / P863 v2.400
|
|
|
|
|
- Aachen Impulse Response (AIR) Database
|
|
|
|
|
- Download https://www2.iks.rwth-aachen.de/air/air_database_release_1_4.zip
|
|
|
|
|
- Input probing signals and noise tracks (you can make your own dataset - *1)
|
|
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
- Compile WebRTC
|
|
|
|
|
- Go to `out/Default/py_quality_assessment` and check that
|
|
|
|
|
`apm_quality_assessment.py` exists
|
|
|
|
|
|
2017-09-26 05:53:19 -07:00
|
|
|
## Unit tests
|
|
|
|
|
- Compile WebRTC
|
|
|
|
|
- Go to `out/Default/py_quality_assessment`
|
2017-10-10 13:28:56 +02:00
|
|
|
- Run `python -m unittest discover -p "*_unittest.py"`
|
2017-09-26 05:53:19 -07:00
|
|
|
|
2017-04-04 07:27:03 -07:00
|
|
|
## First time setup
|
|
|
|
|
- Deploy PolqaOem64 and set the `POLQA_PATH` environment variable
|
|
|
|
|
- e.g., `$ export POLQA_PATH=/var/opt/PolqaOem64`
|
|
|
|
|
- Deploy the AIR Database and set the `AECHEN_IR_DATABASE_PATH` environment
|
|
|
|
|
variable
|
|
|
|
|
- e.g., `$ export AECHEN_IR_DATABASE_PATH=/var/opt/AIR_1_4`
|
|
|
|
|
- Deploy probing signal tracks into
|
|
|
|
|
- `out/Default/py_quality_assessment/probing_signals` (*1)
|
|
|
|
|
- Deploy noise tracks into
|
|
|
|
|
- `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
|
2017-04-11 01:06:28 -07:00
|
|
|
encoded in the 16 bit signed format (it is recommended that the tracks are
|
|
|
|
|
converted and exported with Audacity).
|
2017-04-04 07:27:03 -07:00
|
|
|
|
|
|
|
|
## Usage (scores computation)
|
|
|
|
|
- Go to `out/Default/py_quality_assessment`
|
|
|
|
|
- Check the `apm_quality_assessment.sh` as an example script to parallelize the
|
|
|
|
|
experiments
|
|
|
|
|
- Adjust the script according to your preferences (e.g., output path)
|
|
|
|
|
- Run `apm_quality_assessment.sh`
|
|
|
|
|
- The script will end by opening the browser and showing ALL the computed
|
|
|
|
|
scores
|
|
|
|
|
|
|
|
|
|
## Usage (export reports)
|
|
|
|
|
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:
|
|
|
|
|
|
2017-08-01 04:37:21 -07:00
|
|
|
- Set `--output_dir, -o` to the same value used in `apm_quality_assessment.sh`
|
2017-04-04 07:27:03 -07:00
|
|
|
- Use regular expressions to select/filter out scores by
|
|
|
|
|
- APM configurations: `--config_names, -c`
|
2017-08-01 04:37:21 -07:00
|
|
|
- capture signals: `--capture_names, -i`
|
|
|
|
|
- render signals: `--render_names, -r`
|
|
|
|
|
- echo simulator: `--echo_simulator_names, -e`
|
2017-04-11 01:06:28 -07:00
|
|
|
- test data generators: `--test_data_generators, -t`
|
2017-08-01 04:37:21 -07:00
|
|
|
- scores: `--eval_scores, -s`
|
2017-04-04 07:27:03 -07:00
|
|
|
- Assign a suffix to the report name using `-f <suffix>`
|
|
|
|
|
|
|
|
|
|
For instance:
|
|
|
|
|
|
|
|
|
|
```
|
2017-09-11 17:56:20 +02:00
|
|
|
$ ./apm_quality_assessment_export.py \
|
2017-08-01 04:37:21 -07:00
|
|
|
-o output/ \
|
2017-04-04 07:27:03 -07:00
|
|
|
-c "(^default$)|(.*AE.*)" \
|
2017-08-01 04:37:21 -07:00
|
|
|
-t \(white_noise\) \
|
|
|
|
|
-s \(polqa\) \
|
2017-04-04 07:27:03 -07:00
|
|
|
-f echo
|
|
|
|
|
```
|
|
|
|
|
|
2017-10-04 14:19:06 +02:00
|
|
|
## Usage (boxplot)
|
|
|
|
|
After generating stats, it can help to visualize how a score depends on a
|
2017-10-05 11:16:01 +02:00
|
|
|
certain APM simulator parameter. The `apm_quality_assessment_boxplot.py` script
|
|
|
|
|
helps with that, producing plots similar to [this
|
|
|
|
|
one](https://matplotlib.org/mpl_examples/pylab_examples/boxplot_demo_06.png).
|
2017-10-04 14:19:06 +02:00
|
|
|
|
2017-10-05 11:16:01 +02:00
|
|
|
Suppose some scores come from running the APM simulator `audioproc_f` with
|
2018-08-30 13:01:34 +02:00
|
|
|
or without the level controller: `--lc=1` or `--lc=0`. Then two boxplots
|
2017-10-05 11:16:01 +02:00
|
|
|
side by side can be generated with
|
2017-10-04 14:19:06 +02:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./apm_quality_assessment_boxplot.py \
|
|
|
|
|
-o /path/to/output
|
2017-10-05 11:16:01 +02:00
|
|
|
-v <score_name>
|
2017-10-04 14:19:06 +02:00
|
|
|
-n /path/to/dir/with/apm_configs
|
2018-08-30 13:01:34 +02:00
|
|
|
-z lc
|
2017-10-04 14:19:06 +02:00
|
|
|
```
|
|
|
|
|
|
2017-04-04 07:27:03 -07:00
|
|
|
## Troubleshooting
|
|
|
|
|
The input wav file must be:
|
|
|
|
|
- sampled at a sample rate that is a multiple of 100 (required by POLQA)
|
|
|
|
|
- in the 16 bit format (required by `audioproc_f`)
|
2017-08-01 04:37:21 -07:00
|
|
|
- encoded in the Microsoft WAV signed 16 bit PCM format (Audacity default
|
|
|
|
|
when exporting)
|
2017-04-04 07:27:03 -07:00
|
|
|
|
|
|
|
|
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`).
|