Commit e1615572 authored by Nadir Dalla Pozza's avatar Nadir Dalla Pozza
Browse files

Refactoring

parent 5d9dae35
...@@ -13,8 +13,9 @@ The *Tape Audio Restoration* is written in Python 3.9 which is therefore require ...@@ -13,8 +13,9 @@ The *Tape Audio Restoration* is written in Python 3.9 which is therefore require
``` ```
pip install pyyaml pip install pyyaml
``` ```
[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: [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:
``` ```
pip install control
pip install numpy pip install numpy
pip install scipy pip install scipy
``` ```
...@@ -32,14 +33,14 @@ pip install -r requirements.txt ...@@ -32,14 +33,14 @@ pip install -r requirements.txt
Once the libraries are installed, you should customise the configuration file `config.yaml`. Once the libraries are installed, you should customise the configuration file `config.yaml`.
There are nine required parameters: There are nine required parameters:
1. `WORKING_PATH` that specifies the working path where all input files are stored and where all output files will be saved; 1. `WORKING_PATH` that specifies the working path where all input files are stored and where all output files will be saved;
2. `PRESERVATION_FILE_NAME` that specifies the name of the Preservation Audio File to be considered. Use an empty string 2. `FILES_NAME` that specifies the name of the Preservation Audio File to be considered. Use an empty string
to plot filter frequency response; to plot filter frequency response;
3. `STANDARD_W` that specifies the equalisation standard used to record the tape; 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; 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; 5. `STANDARD_R` that specifies the equalisation standard used to read the tape;
6. `SPEED_R` that specifies the speed used when reading the tape; 6. `SPEED_R` that specifies the speed used when reading the tape;
7. `FS` that specifies the sampling frequency to be used for the filters and the impulse responses. 7. `FS` that specifies the sampling frequency to be used for the filters and the impulse responses.
This parameter won't be considered if `PRESERVATION_FILE_NAME` parameter is not an empty string; This parameter won't be considered if `FILES_NAME` parameter is not an empty string;
8. `BPS` that specifies the bits-per-sample to be used when saving the filter impulse response as WAV; 8. `BPS` that specifies the bits-per-sample to be used when saving the filter impulse response as WAV;
9. `PLOTS` that specifies if the plots of the frequency response should be shown. 9. `PLOTS` that specifies if the plots of the frequency response should be shown.
...@@ -107,7 +108,7 @@ Please note that: ...@@ -107,7 +108,7 @@ Please note that:
* Corresponding input files shall present the same name; * Corresponding input files shall present the same name;
* The name of Irregularity Files given above is ***mandatory***. * The name of Irregularity Files given above is ***mandatory***.
With this structure, `PRESERVATION_FILE_NAME` parameter could be equal to `File1` or `File2`. With this structure, `FILES_NAME` parameter could be equal to `File1` or `File2`.
You can now launch the *Tape Audio Restoration* from the command line with: You can now launch the *Tape Audio Restoration* from the command line with:
``` ```
...@@ -127,6 +128,7 @@ This project was developed by: ...@@ -127,6 +128,7 @@ This project was developed by:
* Sergio Canazza (University of Padova). * Sergio Canazza (University of Padova).
This project takes advantage of the following libraries: This project takes advantage of the following libraries:
* [Control](https://python-control.readthedocs.io/en/0.9.3.post2/index.html);
* [Matplotlib](https://matplotlib.org); * [Matplotlib](https://matplotlib.org);
* [NumPy](https://numpy.org); * [NumPy](https://numpy.org);
* [PyYaml](https://pyyaml.org); * [PyYaml](https://pyyaml.org);
......
# Working path # Working path
WORKING_PATH: "/Users/nadir/Documents/MPAI-CAE/Workflow" WORKING_PATH: "/Users/nadir/Documents/MPAI-CAE/Workflow"
# Name of the Preservation Audio File (without extension) # Name of the Preservation Audio File (without extension)
# Use an empty string to plot filters frequency response FILES_NAME: "sample12_W7N_R15C"
PRESERVATION_FILE_NAME: "sample12_W7N_R15C"
# PRESERVATION_FILE_NAME: "BornToDie" # PRESERVATION_FILE_NAME: "BornToDie"
# PRESERVATION_FILE_NAME: "" # PRESERVATION_FILE_NAME: ""
# Equalisation standard used to record the tape. # Equalisation standard used to record the tape.
...@@ -17,15 +16,6 @@ STANDARD_R: "CCIR" ...@@ -17,15 +16,6 @@ STANDARD_R: "CCIR"
# Reading tape speed [ips]. # Reading tape speed [ips].
# Accepted values: (3.75, 7.5, 15, 30) # Accepted values: (3.75, 7.5, 15, 30)
SPEED_R: 15 SPEED_R: 15
# Sampling frequency to be used for filters and impulse response [Hz].
# Accepted values: (44100, 48000, 96000)
# NOTE: Overwritten with input file one, if any.
FS: 96000
# Bits per sample to be used when saving the filter impulse response audio file.
# Accepted values: (8, 16, 24, 32)
# NOTE_1: Low values (8, 16) may introduce oscillations when exporting the filter impulse response in .wav format.
# NOTE_2: Overwritten with input file one, if any.
BPS: 24
# Enable plotting filter frequency responses # Enable plotting filter frequency responses
# Accepted values: (true, false) # Accepted values: (true, false)
PLOTS: false PLOTS: false
\ No newline at end of file
control==0.9.3.post2
matplotlib==3.6.2
numpy==1.23.5
PyYAML==6.0
scipy==1.10.0
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment