How can i modify this code?

조회 수: 3 (최근 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 CenterFile Exchange에서 Analog Filters에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by