如何将低通滤波器转换为带通滤波器

时间:2009-05-04 17:01:05

标签: signal-processing

我有一个由以下传递函数描述的低通滤波器:

h [n] =(w_c / Pi)* sinc(n * w_c / Pi),其中w_c是截止频率

我必须将此低通滤波器转换为带通滤波器。

3 个答案:

答案 0 :(得分:4)

h[n]转换为频域rect。为了使其成为带通,你需要将其中心频率移动得更高。

要执行此操作,请将h[n]乘以exp(j*w_offset*n),其中w_offset是要转移的金额。如果w_offset为正,那么您将转向更高的频率。

时域中的乘法是频域中的卷积。由于exp(j*w_offset*n)变为以w_offset为中心的脉冲函数,乘法将H(w)移动w_offset

有关详细信息,请参阅Discrete Time Fourier Transform

注意:这样的过滤器不会对称于0,这意味着它将具有复杂的值。要使其对称,您需要添加h[n]乘以exp(-j*w_offset*n)

h_bandpass[n] = h[n](exp(j*w_offset*n)+exp(-j*w_offset*n))

我们得到cos(w*n) = (exp(j*w*n)+exp(-j*w*n))/2

h_bandpass[n] = h[n]cos(w_offset*n)

此过滤器具有纯粹的实际值。

答案 1 :(得分:1)

简短的回答是,您将在时域中乘以复指数。时域中的乘法将在频域中移位信号。

Matlab代码:

n_taps = 100;
n = 1:n_taps;
h = ( w_c / Pi ) * sinc( ( n - n_taps / 2) * w_c / Pi ) .* ...
    exp( i * w_offset * ( n - n_taps / 2) );

P.S。几周前,我碰巧刚为学校实施了这个功能。

以下是使用窗口方法创建自己的带通滤波器的代码:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Function: Create bandpass filter using windowing method
% Purpose:  Simple method for creating filter taps ( useful when more elaborate
%           filter design libraries are not available )
%
% @author   Trevor B. Smith, 24MAR2009
%
% @param    n_taps    How many taps are in your output filter
% @param    omega_p1  The lower cutoff frequency for your passband filter
% @param    omega_p2  The upper cutoff frequency for your passband filter
% @return   h_bpf_hammingWindow     The filter coefficients for your passband filter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function h_bpf_hammingWindow = BPF_hammingWindow(n_taps,omega_p1,omega_p2)
    % Error checking
    if( ( omega_p2 == omega_p1 ) || ( omega_p2 < omega_p1 ) || ( n_taps < 10 ) )
        str = 'ERROR - h_bpf_hammingWindow():   Incorrect input parameters'
        h_bpf_hammingWindow = -1;
        return;
    end

    % Compute constants from function parameters
    length = n_taps - 1; % How many units of T ( i.e. how many units of T, sampling period, in the continuous time. )
    passbandLength = omega_p2 - omega_p1;
    passbandCenter = ( omega_p2 + omega_p1 ) / 2;
    omega_c = passbandLength / 2; % LPF omega_c is half the size of the BPF passband
    isHalfSample = 0;
    if( mod(length,2) == 1 )
        isHalfSample = 1/2;
    end

    % Compute hamming window
    window_hamming = hamming(n_taps);

    % Compute time domain samples
    n = transpose(-ceil(length/2):floor(length/2));
    h1 = sinc( (1/pi) * omega_c * ( n + isHalfSample ) ) * pi .* exp( i * passbandCenter * ( n + isHalfSample ) );

    % Window the time domain samples
    h2 = h1 .* window_hamming;
    if 1
        figure; stem(h2); figure; freqz(h2);
    end

    % Return filter coefficients
    h_bpf_hammingWindow = h2;
end % function BPF_hammingWindow()

如何使用此功能的示例:

h_bpf_hammingWindow = BPF_hammingWindow( 36, pi/4, 3*pi/4 );
freqz(h_bpf_hammingWindow); % View the frequency domain

答案 2 :(得分:0)

f[n]为低通滤波器的信号,w_c位于所需频段的下限。您可以通过从原始信号中减去f[n]来获得高于此下限的频率。这是第二个低通滤波器所需的输入。

相关问题