【发布时间】:2021-04-14 21:07:42
【问题描述】:
我试图了解当我尝试用更少的样本重建信号的频谱时会发生什么。我尝试了两种方法。我根据需要的样本数 (N) 重新采样时域信号,然后进行 FFT。在第二种方法中,我只是做了一个 N 点 FFT,正如 MATLAB 所说,N 之后的样本被忽略。令人惊讶的是,第二种方法给出了很好的结果。我不明白为什么。对于基本事实,我使用高斯形频谱模拟时域信号。
我的 MATLAB 程序如下所示。您可以更改 N 的值并查看结果。您还可以更改重新采样信号情况的插值方法。我做了所有类型的检查,我认为 N 点 FFT 表现更好。但是,人们会认为应用 FFT 时重采样信号的性能应该更好。
clear;
close all;
% Simulation of ground truth
n = 512;
[sig_a, sig_f] = DS_simulator(10^(Inf/20), 1, 5, 0.2, n, 7.5); % sig_a is the time domain signal with 512 points and sig_f is the Gaussian spectrum from which sig is derived
figure; plot((abs(sig_f).^2)); % Original spectrum
%% Analysis
N = 256; %Number of fft points
idx = 1:n;
idxq = linspace(min(idx), max(idx), N);
sig_resampled = interp1(idx, sig_a, idxq, 'cubic'); % resampling the signal
figure; plot(1:1:n, abs(sig_a)); hold on; plot(1:n/N:n, abs(sig_resampled), '*'); % signal and resampled signal
sig_resamp_doppler = 1/N .* abs(fftshift(fft(sig_resampled, N))).^2; % FFT of resampled signal
sig_doppler = 1/N .* abs(fftshift(fft(sig_a, N))).^2; % FFT of original signal
figure; plot(abs(sig_doppler)); hold on; plot(abs(sig_resamp_doppler)); % Reconstructed spectrum
地面实况信号生成代码,其频谱为高斯形状,均值为 mu,标准差为 sigma
function [data, data_f] = DS_simulator(SNR, m0, mu, sigma, n, v_amb)
vel_axis = linspace(-v_amb, v_amb, n);
X = rand(1, n);
Theta = 2 .* pi * rand(1, n);
if sigma < 0.02
[~, idx1] = min(abs(vel_axis - mu));
S = dirac(vel_axis - vel_axis(idx1));
idx = S == Inf;
S(idx) = 1;
else
S = m0/sqrt(2*pi*sigma^2) * exp(-(vel_axis - mu).^2/(2*sigma^2));
end
N = sum(S) ./ (n .* SNR); % Noise Power
P = -(S + N) .* log(X); % Power spectrum
data_f = sqrt(P);
data = ifft(fftshift(sqrt(n) .* sqrt(P) .* exp(1j .* Theta)));% complex time domain signal
end
【问题讨论】: