Лабораторная работа: Расчет цифровых фильтров с бесконечными импульсными характеристиками
[h3, f] = freqz(b, a, 1024, fs);
b = round(b * 100) / 100;
a = round(a * 100) / 100;
[h4, f] = freqz(b, a, 1024, fs);
subplot(211);
plot(f, 20 * log10(abs(h)), 'k');
hold on;
plot(f, 20 * log10(abs(h2)), 'g');
plot(f, 20 * log10(abs(h3)), 'b');
plot(f, 20 * log10(abs(h4)), 'r');
legend('Ideal', '4 categories', '3 categories', '2 categories');
grid on;
title('Amlitude response');
ylabel('Chebyshev1');
subplot(212);
plot(f,angle(h), 'k');
hold on;
plot(f,angle(h2), 'g');
plot(f,angle(h3), 'b');
plot(f,angle(h4), 'r');
grid on;
title('Phase response');
ylabel('Chebyshev1');
%%%%%%%%%%%%Elliptic%%%%%%%%%%%%%
figure;
[b, a] = ellip(n, Rp, Rs, Wn);
[h, f] = freqz(b, a, 1024, fs);
b = round(b * 10000) / 10000;
a = round(a * 10000) / 10000;