## 3 Feature Extraction
### Spectral Features  
After informal listening, the authors hypothesised that the bandwidth of the signal may relate to the perceived hardness, with signals with a large bandwidth during the attack portion perceived as hard, and those with a small bandwidth perceived as soft. The bandwidth was estimated from a time-frequency representation of the signal with a window length of 4096 samples, and an overlap of 128 samples. To retain the potentially fast onsets of transient sounds, no window function was applied. For each time window, the lower limit of the bandwidth was calculated by identifying the spectral roll-on frequency, \(f_{c}\), above which 95% of the energy lies, with the equation  
\[\sum_{i=0}^{f_{c}}y_{i}=0.05\sum_{i=0}^{N-1}y_{i} \tag{5}\]  
This calculation is similar to that used in the spectral rolloff feature described by [PERSON] [31]. The upper limit of the bandwidth was the highest frequency whose level was greater than \(-\)75 dBFS. This threshold was identified empirically according to the authors' perceptions of bandwidth. If this threshold is not crossed, the bandwidth is set to 10.8 Hz, the width of one frequency bin. The bandwidth of each time window is then defined as the difference, in Hz, between the upper and lower bandwidth limits. For each onset, the attack time and attack gradient were calculated with the adaptive threshold method as described by [PERSON] [31]. The maximum bandwidth was also calculated within 100 ms of the estimated attack start, \(t_{start}\).  
Since [PERSON] showed that hardness was related to spectral components, the spectral centroid was calculated on the 125 ms of audio following the start of each attack. This calculation method of the spectral centroid is different from the method described in Section 3.3. This feature was calculated for each onset and the average taken across each onset's spectral centroid.  
Several stimuli were rated in the upper-third of the hardness ratings scale despite being very continuous in nature (e.g., held synthesiser chords). The authors hypothesised that these stimuli sounded hard due to high levels of the upper-mid frequencies. This hypothesis is supported by the inclusion of spectral intensity between 2 kHz and 4 kHz as a feature in [PERSON] et al.'s model of musical hardness [6; 7]. To measure the spectral energy within a particular bandwidth, a similar method to the calculation of timbral sharpness was employed: applying a weighting function to the specific loudness of the audio file and summing the result [32]. This upper-midband level feature, \(m\), can be defined by the equation  
\[m=\sum_{i=1}^{Bark=24}N_{i}^{\prime}w_{i} \tag{6}\]  
where \(N_{i}^{\prime}\) is the specific loudness of the \(i^{th}\) Bark band, and \(w_{i}\) is a normal-distribution-shaped weighting function. The upper and lower limits of this weighting function were varied independently in steps of 1 Bark to determine the values that provided the greatest linear correlation between \(m\) and the mean listener ratings of hardness. The values thus chosen were 7 Bark (700 Hz) and 14 Bark (2150 Hz)--a lower frequency range than that used by [PERSON] et al. [6; 7]. The weighting function was calculated with the equation \[w_{i}=\begin{cases}0&i<7\\ \dfrac{p_{i}-p_{7}}{p_{10.5}-p_{7}}&7<i<14\\ 0&i>14\end{cases} \tag{7}\]  
where \(i\) is the Bark band and \(p\) is the normal distribution centred on 10.5 Bark, which is normalised between zero and one by taking the minimum value, and dividing by the range. This normal distribution is calculated with the equation  
\[p_{i}=\dfrac{1}{\theta\sqrt{2\pi}}e^{\frac{-(i-10.5)^{2}}{2\theta^{2}}} \tag{8}\]  
where \(\theta\) is 0.01.  
The weighting filter, \(w_{i}\), is shown graphically for 0 to 24 Bark in Figure 4.  
This upper-midband level was calculated per 4096 samples and averaged across all time windows and not split by onsets. The mean and weighted-average was calculated over all time windows, using the RMS level of each window as weights.