audeering / opensmile

The Munich Open-Source Large-Scale Multimedia Feature Extractor
https://audeering.github.io/opensmile/
Other
553 stars 74 forks source link

Ndst in ./src/lldcore/intensity.cpp #51

Open nick-parslow opened 2 years ago

nick-parslow commented 2 years ago

Hi, I was toying around with the intensity/loudness calculations and I noticed that if I make a standard config with frame step 0.1s and frame width of 0.25s:

   // The frame size in seconds (0.0 = full input, same as frameMode=full)
frameSize = 0.025000

   // The frame step (frame sampling period) in seconds (0.0 = set to the same value as 'frameSize')
frameStep = 0.010000

then Ndst always seems to have value 1, so the line:

long safeN = MIN(Nsrc,MIN(nWin,Ndst));

is always 1 (while Nsrc and nWin will usually be 400 for 16kHz) and so only the first datapoint in the frame is used (and the hamming window is effectively just a scaling value).

This looks like a bug but maybe I'm just mis-interpreting or mis-using the code (?) Is there maybe a way to get Ndst to behave better or maybe is this expected?

chausner-audeering commented 2 years ago

Have you tried with different frameSize/frameStep settings to see for which you get the described behaviour? I would also check which of the three values (Nsrc, nWin and Ndst) becomes 1 and traceback in source where that value comes from.

nick-parslow commented 2 years ago

The problem is defo 'Ndst' (or the logic of using it in that line), the other 2 get set to the correct values

I just tried with : frameSize = 0.01, frameStep = 0 (so will match frameSize) - no change, Nsrc and Nwin are 160, Ndst is 1 for all windows frameSize = 0.1, frameStep = 0 (so will match frameSize) - no change, Nsrc and Nwin are 1600, Ndst is 1 for all windows frameSize = 1, frameStep = 0.5 - no change, Nsrc and Nwin are 16000, Ndst is 1 for all windows

Unfortunately I haven't worked out where the Ndst is being set, I'm assuming there's a loop over the windows set up with frameSize and frameStep and because there's just one output value, Ndst ends up as 1. likely candidates I guess are: ./src/core/winToVecProcessor.cpp ./src/dspcore/windower.cpp but not sure atm.