*Harmonicity Meter*

from KEUWLSOFT

# Summary

Measures Harmonicity (Harmonic to Noise Ratio), Jitter, Shimmer and fundamental harmonic frequency of a continuous sound using the microphone.

Harmocity varies with age, gender & which vowel you pronounce.
Higher harmonicity & lower jitter & shimmer values indicate a purer sound. Each vowel has different harmonic content such that 'a' will have the lowest HNR whilst the 'o' and 'u' sounds will
have higher HNR values but lower Jitter and Shimmer.

• Auto detects sound

• Range: 100 Hz to 2 kHz for fundamental

• Averaging

• Pause Button

• FFT Spectrum

• Basic Tuner

• Shock proof case (...of absolutely no use, but looks nice!).

FOR INDICATION ONLY. Harmonicity will vary depending on how close the source is to the microphone.
Microphone sensitivity varies with frequency and from device to device.
Even amongst scientific literature, it is difficult to find consistency in absolute reported values.

a) Active measurement |
b) Noise between measurements |

# Using the App

The app will start measuring as soon as an audible noise is heard on the microphone.
The 3 dials will show the measured Harmonicity, Jitter and Shimmer calculated from the last 0.74 seconds of data.

After 0.8 seconds, the app will start to average these values and display the average below the associated dials. The
fundamental harmonic frequency is also averaged and shown above the tuner gauge. The averaging time is shown below
the harmonicity gauge. The app will continue averaging these values until either the sound is stopped, or pause is pressed.
On stopping the sound, the app will automatically remove the last 0.8s of data from the averaging. Ignoring the start and end of the
sound is required due to the sound only filling part of the time data set used for analysis. It also reduces skewing the results from
sudden sharp changes as the sound is established/stopped.

The tuner gauge will show the musical note based on the calculated fundamental harmonic frequency. The musical note is based on
the western 12 tone equal temperament scale. If within 10 cents, the note letter will change to orange indicating that the sound is in tune, or green if within 5 cents.
This can be used to tune guitar/other instruments, however see keuwlsoft's other apps for a dedicated tuner.

When no sound is detected, the previously averaged values are shown (provided the sound lasted greater than 1.6 seconds) in a fainter color.
Needles will all go to the left of the dial gauges.

The bars at the bottom give an indication of the volume. If the bars reach the right side, the microphone is being saturated (not good - as it will affect measured values).

Below the volume indicator is an autoscaling time series display of the microphone input.

The frequency spectrum shows the sound intensity between 0 and 2 kHz. The graph is autoscaling and will often be dominated
by the harmonics when a sound is played, or noise otherwise. Harmonics are coloured in orange.

Pause button - This is the only control in the app, useful if you want to stop the measurement in order to write down the values. On unpausing
the app will continue measuring the same sound until the sound is stopped.

# and a bit more technical detail ...

There are no options. Measurement parameters are fixed, suitable for the majority of situations. FFT size, windows, frequency range etc cannot be changed.
Changing measurement parameters can affect results just as changing microphone or device can, therefore they are fixed, making the app easier to use.

The Fast Fourier Transform (FFT) is carried out on 8192 data points from 0.74s of data, sampled at 11.025 kHz (each data point is the average of
4 data points sampled at 44.1 kHz). This gives us a FFT from 0 to 5.5 kHz with 1.35 Hz step resolution. A higher FFT size would result in the same resolution, but a bandwidth increase up to 22 kHz.
Since the fundamental frequency from the human voice is typically a few hundred Hertz, measuring the spectrum above a few kHz will effectively just be adding noise to the measurement.
Therefore the FFT spectrum is windowed between 100 Hz and 4 kHz with a linear fall of in intensity to 50 Hz or 5 kHz. The low frequency cut off is to reduce low frequency noise which is often dominating
and would otherwise just add a lot of noise to the harmonicity measurements. The high frequency fall off is required to limit sudden jumps in harmonicity which could be caused by a harmonic stradling the
cut off frequency. To calculate harmonicity, the FFT bins of the harmonic frequencies plus those 6 either side (corresponding to ~8 Hz) are summed. The remaining bins constitute the noise.
The ratio then used to determine the harmonicity.

The initial raw data series is windowed prior to the FFT to reduce spectral leakage. A Tukey window with alpha=0.1 is used for this purpose. Since the harmonic is periodic, but the noise is random, averaging over a longer time period will give higher HNR values as averaging more random noise will reduce its amplitude relative to the harmonics eventually leaving only the harmonic and non-harmonic components of the sound. However, since the sample length is fixed at 0.74s, the noise constitutes the sum of the random noise plus that of the non harmonic components of the sound.

To determine the fundamental harmonic frequency, polynomials are fitted to the prominent peaks to accurately determine their frequency and an algorithm then used to determine the fundamental. Fundamental frequencies above 2 kHz are ignored (except for the tuner gauge which indicates the musical note between 50Hz and 5kHz). Fundamental frequencies below 100 Hz will affect the HNR value as the fundamental intensity will be decreased from the linear fall off between 100 Hz and 50 Hz already mentioned.

Jitter is a measure of the frequency variation of the sound. Shimmer is a measure of the amplitude variation of the sound.

To calculate the Shimmer and Jitter, the raw data from 0.74s (32768 data points sampled at 44.1kHz) is used. This data is first low pass filtered with a second order Butterworth filter to reduce contribution from higher frequency harmonics and noise. To determine the waveform length, the maximum is found one wavelength on from the previous maximum within a 15% tolerance and polynomial peak fitting used. The time period, T, of each wavelength is used to calculate the relative jitter from:

To calculate the shimmer, the maximum and minimums in each wavelength are used to determine the amplitude, A, and the relative shimmer then calculated using:

Whilst the calculations done here give a good indication of these values, using different computation methods can result in different values. Therefore consider the relative differences between sounds and not their absolute values when comparing to literature since measurement parameters and calculation methods vary.

The update interval for calculations is set to 0.1s, although this may be longer on slower devices.