Azzera filtri
Azzera filtri

Chebyshev type 2 filter comparison on bode plot

1 visualizzazione (ultimi 30 giorni)
Im trying to create a chebyshev type 2 comparison graph however am unable to get it onto a bode plot keeping the correct characteristics. I have managed this so far however the phase isn't on the log scale. Any help would be greatly appretiated.
fc = 1000;
fs = 8000;
[b1,a1] = cheby2(1,50,fc/(fs/2));
[b2,a2] = cheby2(2,50,fc/(fs/2));
[b3,a3] = cheby2(3,50,fc/(fs/2));
[b4,a4] = cheby2(4,50,fc/(fs/2));
[b5,a5] = cheby2(5,50,fc/(fs/2));
[b6,a6] = cheby2(6,50,fc/(fs/2));
freqz(b1,a1,[],fs)
hold all
freqz(b2,a2,[],fs)
freqz(b3,a3,[],fs)
freqz(b4,a4,[],fs)
freqz(b5,a5,[],fs)
freqz(b6,a6,[],fs)
set(gca, 'XScale', 'log')

Risposta accettata

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 17 Feb 2023
Here is how it can be achieved - see the last figure. The fcn linkaxes() is needed.
fc = 1000;
fs = 8000;
[b1,a1] = cheby2(1,50,fc/(fs/2));
[b2,a2] = cheby2(2,50,fc/(fs/2));
[b3,a3] = cheby2(3,50,fc/(fs/2));
[b4,a4] = cheby2(4,50,fc/(fs/2));
[b5,a5] = cheby2(5,50,fc/(fs/2));
[b6,a6] = cheby2(6,50,fc/(fs/2));
freqz(b1,a1,[],fs)
hold all
freqz(b2,a2,[],fs)
freqz(b3,a3,[],fs)
freqz(b4,a4,[],fs)
freqz(b5,a5,[],fs)
freqz(b6,a6,[],fs)
ax(1)=subplot(211);
ax(2)=subplot(212);
linkaxes(ax)
set(ax, 'XScale', 'log')

Più risposte (1)

Star Strider
Star Strider il 17 Feb 2023
A 3D plot option—
fc = 1000;
fs = 8000;
for k = 1:6
[b,a] = cheby2(k,50,fc/(fs/2));
bv{k} = b;
av{k} = a;
[h,f] = freqz(b,a,2^16,fs);
hv{k} = h;
fv{k} = f;
end
fmtx = abs(cell2mat(cat(2,fv)));
hmtx = mag2db(abs(cell2mat(cat(2,hv))));
pmtx = rad2deg(angle(cell2mat(cat(2,hv))));
nv = ones(size(fmtx,1),1)*(1:6);
figure
subplot(2,1,1)
plot3(fmtx, nv, hmtx)
set(gca, 'XScale', 'log')
grid on
xlabel('f (Hz)')
ylabel('n')
zlabel('Magnitude (dB)')
view(60,30)
subplot(2,1,2)
plot3(fmtx, nv, pmtx)
set(gca, 'XScale','log')
grid on
xlabel('f (Hz)')
ylabel('n')
zlabel('Phase (°)')
view(60,30)
.

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by