I think the basics have been hit by others (just had time to skim), but a couple of points:
As other have pointed out, zero padding increases the sample rate (oversampling) in the frequency domain; add: if you care about the absolute phase being correct, you need to make sure you’re zero-phase zero padding (padding the middle of the fft buffer—this assumes you used zero-phase windowing also). You can use parabolic interpolation to increase peak detection accuracy between “bins”; I didn’t read this page but it looks like it covers the general idea: https://ccrma.stanford.edu/~jos/parshl/Peak_Detection_Steps_3.html > On Mar 31, 2015, at 3:12 PM, MF <ukel...@gmail.com> wrote: > > given a N-point window h(n), how do I create an oversampled Fourier > transform H out of h(n)? I need to have very high resolution of the H so > that I can find out the magnitude of arbitrary frequency with little > frequency error. > > > This is what I did: to oversample h(n) with factor 2, I first sampled the > window h with N * 2 points, and then simply FFT the 'new h' with N*2-point. > But the H with N*2 points looks very different from H with N points. What > am I doing wrong? > > > Here is detailed description with some sample output of the original and > oversampled fft > > > This is my windowing function: > > *function blackman(N)* > > a0 = 0.42659; > > a1 = 0.49656; > > a2 = 0.076849; > > w = zeros(N); > > > for n = 1:N > > w[n] = a0 - a1 * cos(2*pi*n/(N-1)) + a2 * cos(4*pi*n/(N-1)); > > end > > return w; > > end > > > I assume an oversampled fft of the window function by a factor of 2 would > be *fft(blackman(N*2))* > > > However, the fft values of the original and the oversampled value aren't > increasing/decreasing in a similar way (I expect the oversampled version to > takes twice as much samples to increase and decrease, in case the > over-sample factor is 2). > > > Here are some the fft sample values from 1 - 10. the original is > FFT(blackman(512)), the oversampled is FFT(blackman(512 * 2)) > > > k = 1 > > original: 217.9943833003818 + 0.0im > > oversampled: 873.2366098911153 + 0.0im > > k = 2 > > original: -127.11893711697411 - 2.340240508514901im > > oversampled: -508.4935935475258 - 2.3400747304536136im > > k = 3 > > original: 19.845020222085132 + 0.7309352010595286im > > oversampled: 78.87486492124337 + 0.7259756614936985im > > k = 4 > > original: 0.00044320678301414774 + 2.423663020980352e-5im > > oversampled: 0.0005516543659794568 + 7.61242746175689e-6im > > k = 5 > > original: 0.007485288714345478 + 0.0005517961643643162im > > oversampled: 0.00748836292444639 + 0.00013785416101184825im > > k = 6 > > original: 0.0060558634779024605 + 0.000558513387226844im > > oversampled: 0.00605535370050697 + 0.00013934970191932598im > > k = 7 > > original: 0.004581346143077173 + 0.0005075321354533686im > > oversampled: 0.004584081103264545 + 0.0001265980340830028im > > k = 8 > > original: 0.0035101418651299794 + 0.0004541979779443242im > > oversampled: 0.003516027383715841 + 0.0001132935089731223im > > k = 9 > > original: 0.0027517589243924367 + 0.00040747551324277084im > > oversampled: 0.0027600729094881945 + 0.00010164856218561597im > > k = 10 > > original: 0.002205670972923391 + 0.0003679932983093956im > > oversampled: 0.0022158009449307643 + 9.181309340287595e-5im > > > What's wrong with my approach? > > > Thanks in advance! > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp > links > http://music.columbia.edu/cmc/music-dsp > http://music.columbia.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://music.columbia.edu/cmc/music-dsp http://music.columbia.edu/mailman/listinfo/music-dsp