RobinSchmidt / RS-MET

Codebase for RS-MET products (Robin Schmidt's Music Engineering Tools)
Other
56 stars 6 forks source link

on the amplitude gaps in the spectral models #303

Open RobinSchmidt opened 4 years ago

RobinSchmidt commented 4 years ago

i think, i have found a hint to what causes the amplitude gaps that we sometimes see in the analysis data in the sinusoidal models. i created a test signal containing 5 sines at 100, 900, 995,1005,1100Hz - all of unit amplitude. so this is supposed to be a signal with a fundamental at 100Hz with a partial at 1000Hz that shows strong beating (sandwiched between two perfect harmonics). i plotted the envelopes for the 900,1000,1100 partials that the analyzer gives with zero-padding=4, cycles-per-block =4, window=blackman:

image

which clearly exposes the problem. the blue function is the beating partial, green and black the other two that surround it (black is covered by green - they are identical). but when i switch to the hamming window, i get this:

image

no erratic popping in and out anymore. i think, for further experiments, i will implement the dolph-chebychev window - this has a continuous parameter which lets us adjust the width of the window's mainlobe, so it will let us continuously adjust between a hamming-like and blackman-like window and beyond (in fact, it is supposed to even better than these two for this purpose)

elanhickler commented 4 years ago

are you saying something obvious? that two harmonics nearby in frequency causes beating or something less obvious? 995 and 1005 are pretty close together.

RobinSchmidt commented 4 years ago

i mean the amplitude gaps in the nearby partials - at 900 and 1100. somehow, the strongly beating partial at 1000 messes up the analysis of these. when the blue curve it at maximum, the green (and black, not visible) drops out for some reason

elanhickler commented 4 years ago

ok, I see. It's good to know you're learning how to get more accurate readings, not sure how this helps us immediately, but there's a never ending source of problems analyzing signals.

RobinSchmidt commented 4 years ago

ok - i have the Dolph-Chebychev window up and running in rsHarmonicAnalyzer. here is what i get when i use it with 60 dB rejection (everything else, as above):

image

as i said (edit: or, well - did i? maybe in some other thread?), the 60 dB version corresponds roughly to the Blackman window, so this result should be compared compared to the very first plot in the first post. as we can see, there are still gaps - but they are shorter. reducing the sidelobe attenuation to 58 dB, the gaps close fully:

image

58 dB is actually still very Blackman-like. in fact, the maximum sidelobe level of the blackman window is closer to 58 than to 60, 60 was more an approximate thumb rule.

sooo...with this new window in place, i would suggest the following strategy: start with some reasonable value of around 60 dB and if there are gaps, try again with lower values until all gaps have disappeared. i want to try this next with some real-world signals that showed the gaps-problem. maybe, when reducing the attenuation, other artifacts may appear...we should watch out for this