/ tutorials / wave-acoustics
Sign in
tutorials / wave-acoustics
wave-acoustics / src / matlab / wv_window.m
11 lines · 528 BCodeBlameHistory
2% WV_WINDOW A smooth taper for spectral estimates: sin(pi t)^8 on n points.
3%
4% The eighth power is deliberate. Its sidelobes fall off like k^-9, so a
5% strong partial ten bins away leaks into a weak one at about 1e-9 of its
6% amplitude, which is what lets wv_peakfreq measure a frequency to nine or
7% ten digits from a few dozen periods. The price is a main lobe about five
8% bins wide, which only matters when two partials are closer than that.
9t = ((0:n-1)' + 0.5) / n;
10w = sin(pi * t) .^ 8;
11end
↑↓ move↵openescclose