为什么通过补零或使用 Chirp Z 变换的 FFT 插值会在对应于频率小于单音正弦曲线输入频率的频率上产生最大值?
我试图从仅捕获 1-2 个音调波长的数据集中精确确定单音正弦波的频率。为此,我尝试使用零填充插值和 Chirp Z 变换。当我执行插值时,FFT 或 CZT 中的最大值落入与输入正弦波频率不对应的 bin 中,而是始终下冲。此外,输入正弦波与相同频率的复指数之间的卷积在幅度上小于输入与对应于最大FFT bin的频率的复指数之间的卷积。这显然违背了正弦曲线的特性。
我试图通过开窗、使用不同的插值因子、使用不同的长度和频率输入信号以及使用其他 fft 代码来诊断这个问题,但没有成功。
下面是 matlab 代码,它执行输入正弦曲线的 fft 的插值,绘制 fft 和 czt,绘制输入正弦曲线以及对应于最大 bin 的正弦曲线,最后执行输入和正弦曲线之间的卷积FFT 最大 bin 和输入频率。
%create input sinusoid
M = 100;
m = linspace(-pi,pi,M);
f = 2;
x = sin(f*m);
%set interpolation factor and run zeropadded fft
N = M*100;
FFT = fft(x,N);
%define czt parameters
r1 = 0;
r2 = .1;
a = exp(2j*pi*(r1));
w = exp(-2j*pi*(r2-r1)/N);
CZT = czt(x,N,w,a);
%Plot interpolated FFT and CZT
figure, plot(abs(FFT))
hold on
plot(abs((CZT)))
legend('fft','czt')
% Find index of maximum bin for FFT and CZT
[~,indexFFT] = max(abs(FFT(1:N/2)));
[~,indexCZT] = max(abs(CZT(1:N/2)));
% Create sinusoids from the extracted bins to compare against input
% sinusoid
a = exp(-2j*pi*(indexFFT-1)*(linspace(1,M,N))/(N));
b = real(a);
a2 = exp(-2j*pi*(indexCZT-1)*(linspace(1,M,N))/(N/(r2-r1)));
b2 = real(a2);
a3 = exp(-2j*pi*(f)*(linspace(1,M,M))/(M));
b3 = real(a3);
figure,plot(linspace(1,M,N),b,'-.')
hold on
plot(linspace(1,M,N),b2,'--')
plot(linspace(1,M,M),b3,':k')
hold off
legend('FFT','CZT','input sinusoid')
title('the sinusoid associated with the maximum FFT bin')
% Perform convolution between zeropadded input and the sinusoid from the
% fft max bin, and compare against the convolution with the true sinusoid with true frequency
x_Padded = zeros(1,N);
x_Padded(1:M) = x;
X = 0;X2 = 0;
for n=1:N
X = X + x_Padded(n)*exp(-2j*pi*(f)*(n-1)/(M));
X2 = X2 + x_Padded(n)*exp(-2j*pi*(indexFFT-1)*(n-1)/(N));
end
X2_mag = abs(X2);
X_mag = abs(X);