xref: /aosp_15_r20/external/libopus/dnn/torch/lossgen/README.md (revision a58d3d2adb790c104798cd88c8a3aff4fa8b82cc)
1#Packet loss simulator
2
3This code is an attempt at simulating better packet loss scenarios. The most common way of simulating
4packet loss is to use a random sequence where each packet loss event is uncorrelated with previous events.
5That is a simplistic model since we know that losses often occur in bursts. This model uses real data
6to build a generative model for packet loss.
7
8We use the training data provided for the Audio Deep Packet Loss Concealment Challenge, which is available at:
9
10http://plcchallenge2022pub.blob.core.windows.net/plcchallengearchive/test_train.tar.gz
11
12To create the training data, run:
13
14`./process_data.sh /<path>/test_train/train/lossy_signals/`
15
16That will create an ascii loss\_sorted.txt file with all loss data sorted in increasing packet loss
17percentage. Then just run:
18
19`python ./train_lossgen.py`
20
21to train a model
22
23To generate a sequence, run
24
25`python3 ./test_lossgen.py <checkpoint> <percentage> output.txt --length 10000`
26
27where <checkpoint> is the .pth model file and <percentage> is the amount of loss (e.g. 0.2 for 20% loss).
28