How to create linear phase filters for filter bank?

3 views (last 30 days)
soso maths
soso maths on 16 Dec 2021
Commented: Mathieu NOE on 17 Dec 2021
I tried firpr2chfb function as follows
N = 19;
[h0,h1,g0,g1] = firpr2chfb(N,.45);
fvtool(h0, 1, h1, 1)
I have something like, and I don't think these are linear phase filters

Answers (1)

Mathieu NOE
Mathieu NOE on 16 Dec 2021
hello
the phase roll rate must be constant like in the example below
%% define filters
fs = 10000;
freq = linspace(100,(fs/2),500);
% 1 - LPF FIR / cutoff frequency 3 KHz
N = 64;
fc_lp = 1000;
B_lp = fir1(N,2*fc_lp/fs);
h_lp=freqz(B_lp,1,freq,fs);
m_lp=20*log10(abs(h_lp));
% 2 - BPF FIR / cutoff frequencies 2 and 5 KHz
N = 64;
fc_low = 1000;
fc_high = 3000;
B_bp = fir1(N,2*[fc_low fc_high]/fs);
h_bp=freqz(B_bp,1,freq,fs);
m_bp=20*log10(abs(h_bp));
% 3 - HPF FIR / cutoff frequency 4 KHz
N = 64;
fc_high = 3000;
B_hp = fir1(N,2*fc_high/fs,'high');
h_hp=freqz(B_hp,1,freq,fs);
m_hp=20*log10(abs(h_hp));
figure(1),
subplot(211),plot(freq,m_lp,freq,m_bp,freq,m_hp);
title('FIR Filters Response');
ylabel('Gain in dB');
legend('LPF','BPF','HPF');
subplot(212),plot(freq,180/pi*angle(h_lp),freq,180/pi*angle(h_bp),freq,180/pi*angle(h_hp));
ylabel('Phase(°)');
xlabel('Frequency (Hz)');
legend('LPF','BPF','HPF');
  2 Comments
Mathieu NOE
Mathieu NOE on 17 Dec 2021
hello
as far as I remember , linear-phase FIR filter overall group delay is (N-1)/2 where N is the length of the filter
I don't see where the channel number's has an impact on group delay

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by