重叠保存方法零填充fft吉布现象

信息处理 过滤器设计 频域 重叠保存
2022-02-22 23:16:38

我在频域做重叠保存方法。我使用频率采样方法将汉克尔函数制作为数字滤波器(制作任意幅度的相位滤波器)。我做ifft和零填充fft

我听说如果过滤器是非因果的,则零填充 fft 会出现吉布现象。我的过滤器有同样的问题。我正在做移位 FIR 滤波器来制作因果滤波器,但问题没有解决....请帮帮我



    clear all;
    close all;

    %% parameter
    
    fs = 2000;
    ts = 1/fs;
    c = 340;
    R = 1;
    
    %% hankel filter     
    Lp = 50;
    N = 2*Lp+1;                     %filter length
    resol = 0:N-1;                  % frequency resolution
    f = resol/N*fs;
    k = 2*pi*f/c;
    M=5;
    R = 2;
    nu = 2;                   %hankel order
    
    
    % frequency sampling method

    right = besselh(nu,k(1:(N-1)/2 +1)*R); %Hankel function 0~pi
    right(1:5) = 0;                     %eliminate infinite part
    left = fliplr(right);              
    left = conj(left);                  
    left(end) = [];
    
    H = [right left];               % symmetric freuqnecy response
    h = ifft(H);                % impulse response   
    
    nn = 80;                        %shift index 
    h1 = [h(nn : end) h(1:nn-1)];   % shift impulse response to make causal filter
    H1 = fft(h1,2*N);               %zero padding fft

    
    subplot(2,1,1)
    plot(h1)
    subplot(2,1,2)
    plot(abs(H1))

1个回答

吉布斯现象是由频率采样方法引起的。我建议您改用窗口方法。它快速、方便且坚固,尽管不是最佳的。顺便说一句,频率范围应该是 0~fs/2,我在下面的代码中修复了它

clear;
close all;

%% parameter
fs = 2000;
ts = 1/fs;
c = 340;

%% hankel filter     
Lp = 50;
N = 2*Lp+1;                     % filter length
NN = 2^nextpow2(N * 100);       % NN >> N
resol = 0:NN-1;                  % frequency resolution
f = resol/NN*fs/2;              % you miss /2 here
k = 2*pi*f/c;
M = 5;
R = 2;
nu = 2;                   %hankel order

% window method
right = besselh(nu,k(1:(NN-1)/2 +1)*R); %Hankel function 0~pi
right(1:200) = 1;                     %eliminate infinite part
left = fliplr(right);              
left = conj(left);                  
left(end) = [];

H = [right left];               % symmetric freuqnecy response
h = ifft(H);                % impulse response   

h1 = ifftshift(h);   % shift impulse response to make causal filter
win = hann(N).';
h2 = h1(NN/2-N/2:NN/2+N/2-1) .* win; % windowed impulse response
H2 = fft(h2,2*N);               %zero padding fft

figure;
subplot(2,1,1)
plot(h2)
subplot(2,1,2)
plot(abs(H2))

频率采样方式:

频率采样

窗口方法:

窗户