## 3 Methodology
### Feature Extraction and Selection
#### 3.2.2 Chroma STFT  
The Chroma STFT is a powerful tool for audio signal analysis, especially in music and speech processing. At its core, the Chroma STFT was designed to capture the harmonic content of an audio signal by focusing on the relative intensity of twelve distinct pitch classes, often corresponding to the twelve traditional Western music pitches.  
The primary motivation behind the Chroma STFT is rooted in the observation that many musical pieces exhibit harmonic shifts over time, but often within the same set of pitch classes. By mapping these pitch classes to a fixed set of twelve bins, regardless of the number of octaves, the Chroma STFT provides a compact representation of the audio signal's harmonic content.  
Mathematically, the Chroma STFT \(C\) of an audio signal \(x(t)\) can be represented as  
\[C(n,k)=\sum_{m=-\infty}^{\infty}x(m)w(n-m)e^{-j\omega_{k}m} \tag{1}\]  
where  
* \(n\) is the time index.
* \(k\) corresponds to one of the twelve pitch classes.
* \(w(n)\) is a window function, which is typically chosen based on the application (e.g., Hamming or Hann window).
* \(\omega_{k}\) is the angular frequency corresponding to the \(k\)-th pitch class.  
Figure 6: Time–frequency diagrams of abnormal PCGs (a0006.wav [11]): (**a**) original file, (**b**) noise-filtered clipped to 600 Hz, (**c**) harmonic component of noise-filtered signal clipped to 600 Hz, (**d**) permissive component of noise-filtered signal clipped to 600 Hz, (**e**) harmonic component with margin 4 of noise-filtered signal clipped to 600 Hz, and (**f**) permissive component with margin 4 of noise-filtered signal clipped to 600 Hz.  
Figure 7: Time–frequencydiagrams of normal PCGs (a0007.wav [11]): (**a**) original file, (**b**) noise-filtered clipped to 600 Hz, (**c**) harmonic component of noise-filtered signal clipped to 600 Hz, (**d**) percussive component of noise-filtered signal clipped to 600 Hz, (**e**) harmonic component with margin 4 of noise-filtered signal clipped to 600 Hz, and (**f**) percussive component with margin 4 of noise-filtered signal clipped to 600 Hz.  
Figure 8: Waveplots of abnormal PCGs (a0006.wav [11]): (**a**) original signal; (**b**) harmonic and percussive components of original file; (**c**) with margin 4 on harmonic and percussive components of original signal.  
Figure 9: Waveplots of abnormal PCGs (a0006.wav [11]) with noise-filtered frequency clipped to 600 Hz: (**a**) noise-filtered signal; (**b**) harmonic and percussive components; (**c**) with margin 4 on harmonic and percussive components.  
The resulting Chroma STFT matrix provides a time-pitch representation, where each column corresponds to a specific time frame, and each row represents one of the twelve pitch classes. The intensity or magnitude in each cell of the matrix indicates the strength or prominence of a particular pitch class at a specific time.  
Figure 11: Waveplots of normal PCGs (a0007.wav [11]) with noise-filtered frequency clipped to 600 Hz: (**a**) noise-filtered signal; (**b**) harmonic and percussive components; (**c**) with margin 4 on harmonic and percussive components.  
Figure 10: Waveplots of normal PCGs (a0007.wav [11]): (**a**) original signal; (**b**) harmonic and percussive components of original file; (**c**) with margin 4 on harmonic and percussive components of original signal.  
By extracting the Chroma STFT feature, researchers and practitioners can profile an audio signal based on the intensity of each extracted pitch. This profiling is invaluable in various applications, including music genre classification, chord recognition, and even in some speech processing tasks where pitch and tonality play a crucial role.