# Pareto-Optimized AVQI Assessment of Dysphonia: A Clinical Trial Using Various Smartphones
## 3 Materials and Methods
### Calculating Required Voice Characteristics
```
1:\(sound\)Wav, the sound waveform
2:\(pointProcess\), the point process representing glottal closures
3:\(startTime\), the start time in seconds
4:\(endTime\), the end time in seconds
5:\(shimmerLocal\), the shimmer local value
6:\(shimmerDB\), the shimmer dB value
7: Extract a pitch contour from the sound using the Sound: To Pitch...command with the following settings:
8:- pitch floor: 75 Hz
9:- pitch ceiling: 600 Hz
10:- time step: 0.01 s
11:- range of analysis: \(startTime\) to \(endTime\)
12: Convert the pitch contour to a point process using the Pitch: To PointProcess command with the following settings:
13:- silences: unvoiced
14:- voicing threshold: 0.45
15:Initialize a list to store the amplitude differences
16:for each period in the point process do
17: Get the start and end times of the period
18: Calculate the amplitude difference between the two points in the waveform that correspond to the start and end times
19: Append the absolute value of the amplitude difference to the list
20:endfor
21:Calculate the average amplitude difference and the average amplitude:
22:- Calculate the mean of the amplitude difference list and store it as \(amplitudeDiffAvg\)
23:- Calculate the mean of the absolute values of the waveform and store it as \(amplitudeAvg\)
24:- Calculate the shimmer local value:
25:- Divide \(amplitudeDiffAvg\) by \(amplitudeAvg\) and multiply by 100
26:- Store the result as \(shimmerLocal\)
27:- Calculate the shimmer dB value:
28:- Calculate the base-10 logarithm of each amplitude difference value in the list and store the result as a new list
29:- Calculate the mean of the new list and multiply by 20
30:- Store the result as \(shimmerDB\)
31:Return \(shimmerLocal\) and \(shimmerDB\)
```  
**Algorithm 5** Shimmer calculation. In the fourth step, we need to calculate the long-term average spectrum (LTAS) (see Figure 9). The algorithm to calculate the LTAS (long-term average spectrum) is presented in Algorithm 6. This algorithm calculates the LTAS of a given sound waveform and computes the slope and tilt parameters. The LTAS is a smoothed version of the spectrum of the sound waveform, calculated over a long period of time, typically several seconds. ```
0:\(soundWav\): the sound waveform
0:\(slope\_dB\): the slope in dB and \(tilt\): the tilt parameter
1:\(ltas\leftarrow\) call(soundWav, \"To \(Ltas\_\)\", 1) \(\triangleright\) Convert sound waveform to Ltas
2:for\(i\gets 0\) to \(N-1\)do\(\triangleright\) Calculate power in each band
3:\(s\_i\leftarrow\) call(ltas, \"Get frequency\", i)
4:\(re\_si\leftarrow\) call(ltas, \"Get real\", i)
5:\(im\_si\leftarrow\) call(ltas, \"Get imaginary\", i)
6:\(b_{i}\gets 2((re\_si)^{2}+(im\_si)^{2})/4.0\cdot 10^{-10}\)\(\triangleright\) Calculate band power
7:endfor
8:\(slope\_dB\leftarrow\) call(ltas, \"Get slope...\", 0, 1000, 1000, 10000, \"energy\") \(\triangleright\) Calculate slope
9:\(ltas\_trendline\_db\leftarrow\) call(ltas, \"Compute trend line\", 1, 10000) \(\triangleright\) Compute trendline
10:\(tilt\leftarrow\) call(ltas_trendline_db, \"Get slope\", 0, 1000, 1000, 1000, \"energy\") \(\triangleright\) Calculate tilt parameter
11:return\(slope\_dB,tilt\)
```  
**Algorithm 6** LTAS calculation. Figure 8: Calculation of the shimmer values. Finally, we calculate the AVQI values (see Figure 10) given several acoustic measures of voice quality. The calculation algorithm is given in Algorithm 7. The Pareto optimization of AVQI scores is given in Algorithm 8. Figure 10: Calculation of the AVQI values. Figure 9: Calculation of the LTAS values. ```
1:Define the relevant voice quality parameters and define AVQI score as the objective to be optimized. 2:Select a set of candidate solutions that represent different combinations of the voice quality parameters. 3:Calculate the AVQI scores for each candidate solution using a combination of objective and subjective methods. 4:Plot the candidate solutions on a Pareto front to visualize the trade-off between the objectives.