see below.

---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] tracking drum partials
From: "Thomas Rehaag" <develo...@netcologne.de>
Date: Thu, July 27, 2017 4:02 pm
To: music-dsp@music.columbia.edu
--------------------------------------------------------------------------

>
> @Robert:
> I didn't quite get "for analysis, i would recommend Gaussian windows
> because each partial will have it's own gaussian bump in the frequency
> domain ..."
> Looks like you wouldn't just pick up the peaks like I do.
>

well, i *would* sorta, but it's not always as simple as that.

...


> Next the highest peaks are taken from every FFT and then tracks in time
> are built.
>
> And it looks like I've just found the simple key for better results
> after putting the whole stuff aside for 3 weeks now.
> It's just to use samples from drums that have been hit softly.
> Else every bin of the first FFTs will be crossed by 2 or 3 sweeps which
> leads to lots of artifacts.

are you using MATLAB/Octave?  you might need to think about  fftshift() .

suppose you have a sinusoid that goes on forever and you use a **very** long FFT and transform it. if you can imagine that very long FFT as approximating the Fourier Transform, you will get better than a "peak", you will get a *spike* and +/- f0, the frequency of that sinusoid (the "negative frequency" spike will be at N-f0). in the F.T., it's a pair dirac impulses at +/- f0. then when you multiply by a window in the time domain, that is convolving by the F.T. of the window in the frequency domain. i will call that F.T. of the window, the "window spectrum". a window function is normally a low-pass kinda signal, which means the window spectrum will peak at a frequency of 0. convolving that window spectrum with a dirac spike at f0 simply moves that window spectrum to f0. so it's no longer a spike, but a more rounded peak at f0. i will call that "more rounded peak" the "main lobe" of the window spectrum. and it is what i meant by the "gaussian bump" in the previous response.

now most (actually all, to some degree) window spectra have sidelobes and much of what goes on with designing a good window function is to deal with those sidelobe bumps. because the sidelobe of one partial will add to the mainlobe of another partial and possibly skew the apparent peak location and peak height. one of the design goals behind the Hamming window was to beat down the sidelobes a little. a more systematic approach is the Kaiser window which allows you to trade off sidelobe height and mainlobe width. you would like *both* a skinny mainlobe and small sidelobes, but you can't get both without increasing the window length "L".

another property that *some* windows have that are of interest to the music-dsp crowd is that of being (or not) complementary. that is adjacent windows add to 1. this is important in **synthesis** (say in the phase vocoder), but is not important in **analysis**. for example, the Kaiser window is not complementary, but the Hann window is. so, if you don't need complementary, then you might wanna choose a window with good sidelobe behavior.

the reason i suggested Gaussian over Kaiser was just sorta knee-jerk. perhaps Kaiser would be better, but one good thing about the Gaussian is that its F.T. is also a Gaussian (and there are other cool properties related to chirp functions). a theoretical Gaussian window has no sidelobes. so, if you let your Gaussian window get extremely close to zero before it is truncated, then it's pretty close to a theoretical Gaussian and you need not worry about sidelobes and the behavior of the window spectrum is also nearly perfectly Gaussian and you can sometimes take advantage of that. like in interpolating around an apparent peak (at an integer FFT bin) to get the precise peak location.

now you probably do not need to get this anal-retentive about it, but if you want to, you can look at this: https://www.researchgate.net/publication/3927319_Intraframe_time-scaling_of_nonstationary_sinusoids_within_the_phase_vocoder and i might have some old MATLAB code to run for it, if you want it (or anyone else), lemme know.

big thanks for the elaborate explanation!
Looks like you've turned my head into the right direction.
Had a look at the spectrum of my window: a 4096 Hann win. in the middle of 64k samples.
A big sidelobe party!
A 64k gaussian window that just sets priority to an area of ~4096 samples will of course fix that.

Btw.: no Matlab here. C++ only.

Best Regards,

Thomas


_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to