Last question with this (I think) with regards to the derivatives. In my toy examples (above) this was working ok as I just so happened to be having positive values for the derivatives (of mean of centroid/rolloff). But in testing it now with more arbitrary audio and I’m getting negative values for this, which makes sense.
To convert things to the log (perceptual) domain, I’ve been chucking it to ftom 0.
, but that doesn’t like negative numbers… Or rather, it puts a bunch of -999.
in the subsequent datasets.
I was thinking of abs
-ing it, but that strips away the directionality of the derivatives, which is largely what I’m after. I can also do something like what you mention before (mean(Hz) - derivative(Hz) -> ftom
), but I suppose there could be a situation where that could potentially still produce a negative number (e.g. a low centroid with a large negative derivative).
I could leave the derivative in Hz, but that throws off a lot of the scaling elsewhere.