<jupyter_start><jupyter_text>How to use SoundQuality with SciDatatool MoSQITo is a unified and modular development framework of key sound quality metrics favoring reproducible science and efficient shared scripting among engineers, teachers and researchers community.MoSQITo has been developed as a library of functions, but in order to ease its use, a class called SoundQuality has been created. Its main advantage is the use of [SciDataTool](https://github.com/Eomys/SciDataTool "SciDataTool") objects to store the results and do efficient plots.This tutorial explains how to use the SoundQuality object to calculate the acoustic loudness (Zwicker method) of a time-varying signal from its .wav file.<jupyter_code># Add MoSQITo to the Python path
import sys
sys.path.append('..')

# Import useful packages
import numpy as np
import matplotlib.pyplot as plt

# Import MoSQITo modules
from mosqito.SoundQuality import SoundQuality<jupyter_output><empty_output><jupyter_text>First, it is necessary to create a SoundQuality object, which uses the MOSQITO functions to compute metrics that are then stored in SciDataTool objects.<jupyter_code>SQ = SoundQuality()<jupyter_output><empty_output><jupyter_text>The signal is imported using the 'import_signal' method with 2 arguments, the signal type (True if stationary or False if time-varying) and the file path.Then its third-octave spectrum is computed with the 'comp_3oct_spec' method.<jupyter_code>SQ.import_signal(False,"../mosqito/validations/loudness_zwicker/data/ISO_532-1/Annex B.5/Test signal 24 (woodpecker).wav")
SQ.comp_3oct_spec()<jupyter_output><empty_output><jupyter_text>The loudness is computed using the 'compute_loudness' method.<jupyter_code>SQ.compute_loudness()<jupyter_output><empty_output><jupyter_text>The calculation being done, the results can be plotted or used for further analysis. The SciDataTools objects have different interesting functions for that purpose.<jupyter_code>loudness = SQ.loudness.values
time = SQ.loudness.axes[0].values
plt.plot(time, loudness)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06875, 'fraction_numerical': 0.005288461538461539, 'mean_word_length': 6.594890510948905, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '233225', 'license': 'Apache-2.0', 'n_tokens_mistral': 637, 'n_tokens_neox': 601, 'n_words': 220, 'path': 'tutorials/tuto0_SoundQuality-object-oriented-use-with-SciDataTool.ipynb', 'repo_name': 'JosemaAlvarez/MoSQITo', 'size': '2080'}