with bufspectralshape~ and bufstats~ I am isolating the spectral flatness measure’s mean and median over a sound file. Is the dB value meant to be positive or should I interpret ‘24’, for example, as -24? Indeed, testing on obvious sound files (noise vs sin) and flipping the sign manually I get results I expect.
A sine is a peak in the spectrum so it is the opposite of flat, whereas noise is more flat. The ratio is indeed between 0 and 1 where 1 would be totally flat so 0dB. Here’s a wikipedia explanation:
The ratio produced by this calculation is often converted to adecibel scale for reporting, with a maximum of 0 dB and a minimum of −∞ dB.
I don’t understand you question then. In the helpfile, test code, you get -103 for a sinewave (very low flatness) and -1.5 for white noise (very high flatness) - this is in line with the definition Gerard points at. Flipping the numbers will make it wrong. The way to get it positive would be to add 110. that way you sine would have a very low positive number, and your noise a very high positive number. I don’t know what you get though.
I don’t know what file you are referring to, but this is an error on my part with how I was doing bufstats . I was in fact bufstatting the wrong channel. Is buffer channel referencing still 0 counting and not 1?