I am new to signal processing. Currently, I am reading a paper regarding musical expression. The paper calculates brightness, and I want to reproduce their way of computing it. I was wondering if there's any way to calculate harmonic series from audio data, because I want to calculate the Brightness.
This is from a paper talking about a model called [MIDI-DDSP][2]. Here is the section I can't understand very well.
Brightness is defined as the spectral centroid (in bin numbers) of the harmonic distribution, where $h_k(i)$ represents the $k$-th bin of the harmonic distribution, $h(τ)$ in the $i$-th time-step, and we use $|h|$ to refer to the number of bins in the harmonic distribution used by the DDSP module (we use $|h| = 60$, see Appendix B.2).
I am thinking of two ways. The first way is to use spectral_centroid from Librosa.
The second way is to compute the frequency, and harmonic distribution. For example, the frequency of A4 note is 440, and I want the sum of (440*1 + 880*2 + ..)
in A4 note.
However, I'm uncertain about the first way. And for the second way, is it correct or not? Any recommendation as to what tools I can use to calculate it?