Package: disvoice-prosody
Prosody featuresprosody.pyCompute prosody features from continuous speech based on duration, fundamental frequency and energy.Static or dynamic features can be computed:Static matrix is formed with 103 features and includeNum     Feature                                                          DescriptionFeatures based on F01-6     F0-contour                                                       Avg., Std., Max., Min., Skewness, Kurtosis7-12    Tilt of a linear estimation of F0 for each voiced segment        Avg., Std., Max., Min., Skewness, Kurtosis13-18   MSE of a linear estimation of F0 for each voiced segment         Avg., Std., Max., Min., Skewness, Kurtosis19-24   F0 on the first voiced segment                                   Avg., Std., Max., Min., Skewness, Kurtosis25-30   F0 on the last voiced segment                                    Avg., Std., Max., Min., Skewness, KurtosisFeatures based on energy31-34   energy-contour for voiced segments                               Avg., Std., Skewness, Kurtosis35-38   Tilt of a linear estimation of energy contour for V segments     Avg., Std., Skewness, Kurtosis39-42   MSE of a linear estimation of energy contour for V segment       Avg., Std., Skewness, Kurtosis43-48   energy on the first voiced segment                               Avg., Std., Max., Min., Skewness, Kurtosis49-54   energy on the last voiced segment                                Avg., Std., Max., Min., Skewness, Kurtosis55-58   energy-contour for unvoiced segments                             Avg., Std., Skewness, Kurtosis59-62   Tilt of a linear estimation of energy contour for U segments     Avg., Std., Skewness, Kurtosis63-66   MSE of a linear estimation of energy contour for U segments      Avg., Std., Skewness, Kurtosis67-72   energy on the first unvoiced segment                             Avg., Std., Max., Min., Skewness, Kurtosis73-78   energy on the last unvoiced segment                              Avg., Std., Max., Min., Skewness, KurtosisFeatures based on duration79      Voiced rate                                                      Number of voiced segments per second80-85   Duration of Voiced                                               Avg., Std., Max., Min., Skewness, Kurtosis86-91   Duration of Unvoiced                                             Avg., Std., Max., Min., Skewness, Kurtosis92-97   Duration of Pauses                                               Avg., Std., Max., Min., Skewness, Kurtosis98-103  Duration ratios                                                  Pause/(Voiced+Unvoiced), Pause/Unvoiced, Unvoiced/(Voiced+Unvoiced),
Voiced/(Voiced+Unvoiced), Voiced/Puase, Unvoiced/PauseThe dynamic feature matrix is formed with 13 features computed for each voiced segment and contains:1 Duration of the voiced segment2-7. Coefficients of 5-degree Lagrange polynomial to model F0 contour8-13. Coefficients of 5-degree Lagrange polynomial to model energy contourDynamic prosody features are based on
Najim Dehak, "Modeling Prosodic Features With Joint Factor Analysis for Speaker Verification", 2007Notes:The fundamental frequency is computed the PRAAT algorithm. To use the RAPT method,  change the "self.pitch method" variable in the class constructor.When Kaldi output is set to "true" two files will be generated, the ".ark" with the data in binary format and the ".scp" Kaldi script fileRuningScript is called as followspythonprosody.py<file_or_folder_audio><file_features><static(trueorfalse)><plots(trueorfalse)><format(csv,txt,npy,kaldi,torch)>Examples:Extract features in the command linepythonprosody.py"../audios/001_ddk1_PCGITA.wav""prosodyfeaturesAst.txt""true""true""txt"pythonprosody.py"../audios/001_ddk1_PCGITA.wav""prosodyfeaturesUst.csv""true""true""csv"pythonprosody.py"../audios/001_ddk1_PCGITA.wav""prosodyfeaturesUdyn.pt""false""true""torch"pythonprosody.py"../audios/""prosodyfeaturesst.txt""true""false""txt"pythonprosody.py"../audios/""prosodyfeaturesst.csv""true""false""csv"pythonprosody.py"../audios/""prosodyfeaturesdyn.pt""false""false""torch"pythonprosody.py"../audios/""prosodyfeaturesdyn.csv""false""false""csv"KALDI_ROOT=/home/camilo/Camilo/codes/kaldi-master2exportPATH=$PATH:$KALDI_ROOT/src/featbin/
pythonprosody.py"../audios/001_ddk1_PCGITA.wav""prosodyfeaturesUdyn""false""false""kaldi"pythonprosody.py"../audios/""prosodyfeaturesdyn""false""false""kaldi"Extract features directly in Pythonfrom prosody import Prosody
prosody=Prosody()
file_audio="../audios/001_ddk1_PCGITA.wav"
features1=prosody.extract_features_file(file_audio, static=True, plots=True, fmt="npy")
features2=prosody.extract_features_file(file_audio, static=True, plots=True, fmt="dataframe")
features3=prosody.extract_features_file(file_audio, static=False, plots=True, fmt="torch")
prosody.extract_features_file(file_audio, static=False, plots=False, fmt="kaldi", kaldi_file="./test")Jupyter notebookResults:Prosody analysis from continuous speech staticReferences[1]. N., Dehak, P. Dumouchel, and P. Kenny. "Modeling prosodic features with joint factor analysis for speaker verification." IEEE Transactions on Audio, Speech, and Language Processing 15.7 (2007): 2095-2103.[2]. J. R. Orozco-Arroyave, J. C. Vásquez-Correa et al. "NeuroSpeech: An open-source software for Parkinson's speech analysis." Digital Signal Processing (2017).