How can i modify this code?

1 回表示 (過去 30 日間)
Darsana P M
Darsana P M 2017 年 4 月 2 日
コメント済み: Star Strider 2017 年 4 月 2 日
I would like to obtain 16 bank filters obtained in the below program using direct form 2 filters in iir. What modifcaton should i do?
Fs = 22050; % Samping Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
pf = linspace(20,4000,17); % Passband Frequencies
%pf=[20 100:100:2E+4];
cf = pf(1:end-1)+(pf(2)-pf(1))/2; % Centre Frequencies
for k1 = 1:length(cf)
[z(:,k1),p(:,k1),k(k1)] = butter(7, [pf(k1) pf(k1+1)]/Fn);
[sos{k1},g{k1}] = zp2sos(z(:,k1),p(:,k1),k(k1));
[h(:,k1),w(:,k1)] = freqz(sos{k1},512,Fs);
end
figure(1)
plot(w([1 16],:), abs(h([1 16],:)))
grid
% axis([0 0.2 ylim])
figure(2)
freqz(sos{1})
hold on
for k1 = 2:16
freqz(sos{k1})
%Sf(k1,:) =filtfilt(sos{k1},g{k1},S);
end
hold off
  1 件のコメント
Star Strider
Star Strider 2017 年 4 月 2 日
To use them in a Direct Type II configuration, you have to realize the filters as transfer functions, not second-order-section matrices. You need the numerator and denominator polynomials.
I haven’t done anything with Direct Form filters since graduate school (back in the Precambrian). I do not remember them fondly.
I’m not posting this as an Answer because it isn’t one.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAnalog Filters についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by