README.md 5.95 KB
Newer Older
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
1
# Tape Audio Restoration
Niccolò Pretto's avatar
Niccolò Pretto committed
2

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
3
4
5
6
## Description
Implements the Technical Specification of [MPAI CAE-ARP](https://mpai.community/standards/mpai-cae/about-mpai-cae/#Figure2) *Tape Audio Restoration* AIM, providing:
* Restored Audio Files;
* Editing List.
Niccolò Pretto's avatar
Niccolò Pretto committed
7
8

## Getting started
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
9
The *Tape Audio Restoration* is written in Python 3.9 which is therefore required to run the program.
Niccolò Pretto's avatar
Niccolò Pretto committed
10

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
11
12
## Installation
[PyYaml](https://pyyaml.org) is required for reading the configuration file. You can install it with:
Niccolò Pretto's avatar
Niccolò Pretto committed
13
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
14
15
pip install pyyaml
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
16
[Control](https://python-control.readthedocs.io/en/0.9.3.post2/index.html), [NumPy](https://numpy.org) and [SciPy](https://scipy.org) are required for correcting the audio of the Preservation Audio File. You can install them with:
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
17
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
18
pip install control
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
19
20
21
22
23
24
pip install numpy
pip install scipy
```
Finally, [Matplotlib](https://matplotlib.org) is required for (optionally) plotting the frequency responses of the filters. You can install it with:
```
pip install matplotlib
Niccolò Pretto's avatar
Niccolò Pretto committed
25
26
```

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
27
28
29
30
You can also use `requirements.txt` file to install all needed dependencies at once:
```
pip install -r requirements.txt
```
Niccolò Pretto's avatar
Niccolò Pretto committed
31

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
32
33
## Usage
Once the libraries are installed, you should customise the configuration file `config.yaml`.
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
34
There are six required parameters:
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
35
1. `WORKING_PATH` that specifies the working path where all input files are stored and where all output files will be saved;
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
36
2. `FILES_NAME` that specifies the name of the Preservation Audio File to be considered. Use an empty string 
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
37
38
39
40
to plot filter frequency response;
3. `STANDARD_W` that specifies the equalisation standard used to record the tape;
4. `SPEED_W` that specifies the speed used when recording the tape;
5. `STANDARD_R` that specifies the equalisation standard used to read the tape;
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
41
6. `SPEED_R` that specifies the speed used when reading the tape.
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

To execute the script without issues, the inner structure of the `WORKING_PATH` directory shall be like:
```
.
├── AccessCopyFiles
│   └── ...
├── PreservationAudioFile
│   ├── File1.wav
│   ├── File2.wav
│   └── ...
├── PreservationAudioVisualFile
│   ├── File1.mp4
│   ├── File2.mp4
│   └── ...
├── PreservationMasterFiles
│   └── ...
└── temp
    ├── File1
    │   ├── AudioAnalyser_IrregullarityFileOutput1.json
    │   ├── AudioAnalyser_IrregullarityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    ├── File2
    │   ├── AudioAnalyser_IrregullarityFileOutput1.json
    │   ├── AudioAnalyser_IrregullarityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    └── ...
```
`PreservationAudioFile` and `PreservationAudioVisualFile` directories contain the input of ARP Workflow, while `AccessCopyFiles` and `PreservationMasterFiles` directories contain its output. `temp` directory is used to store all files exchanged between the AIMs within the Workflow.
Niccolò Pretto's avatar
Niccolò Pretto committed
102

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
103
104
105
Please note that:
* Corresponding input files shall present the same name;
* The name of Irregularity Files given above is ***mandatory***.
Niccolò Pretto's avatar
Niccolò Pretto committed
106

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
107
With this structure, `FILES_NAME` parameter could be equal to `File1` or `File2`.
Niccolò Pretto's avatar
Niccolò Pretto committed
108

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
109
110
You can now launch the *Tape Audio Restoration* from the command line with:
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
111
python3 tapeAudioRestoration.py
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
112
113
```
Useful log information will be displayed during execution, requiring occasional interaction.
Niccolò Pretto's avatar
Niccolò Pretto committed
114

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
115
116
117
118
119
120
121
122
123
124
To enable integration in more complex workflows, it is also possible to launch the *Tape Audio Restoration* with command line arguments:
```
python3 tapeAudioRestoration.py [-h] -w WORKING_PATH -f FILES_NAME -ew EQUALIZATION_W -sw SPEED_W -er EQUALIZATION_R -sr SPEED_R
```
If you use the `-h` flag:
```
python3 tapeAudioRestoration.py -h
```
all instructions will be displayed.

Niccolò Pretto's avatar
Niccolò Pretto committed
125
## Support
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
126
127
128
If you require additional information or have any problem, you can contact us at:
* Nadir Dalla Pozza (nadir.dallapozza@unipd.it);
* Niccolò Pretto (niccolo.pretto@unipd.it).
Niccolò Pretto's avatar
Niccolò Pretto committed
129

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
130
131
132
133
134
## Authors and acknowledgment
This project was developed by:
* Nadir Dalla Pozza (University of Padova);
* Niccolò Pretto (University of Padova);
* Sergio Canazza (University of Padova).
Niccolò Pretto's avatar
Niccolò Pretto committed
135

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
136
This project takes advantage of the following libraries:
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
137
* [Control](https://python-control.readthedocs.io/en/0.9.3.post2/index.html);
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
138
139
140
141
* [Matplotlib](https://matplotlib.org);
* [NumPy](https://numpy.org);
* [PyYaml](https://pyyaml.org);
* [SciPy](https://scipy.org).
Niccolò Pretto's avatar
Niccolò Pretto committed
142

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
143
Developed with Python IDE [PyCharm Community](https://www.jetbrains.com/pycharm/).
Niccolò Pretto's avatar
Niccolò Pretto committed
144
145

## License
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
146
This project is licensed with [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.html).