# Chebyshev type 2 filter comparison on bode plot

3 visualizzazioni (ultimi 30 giorni)
Aaron Frost il 17 Feb 2023
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')
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

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);
set(ax, 'XScale', 'log')
##### 2 CommentiMostra NessunoNascondi Nessuno
Aaron Frost il 17 Feb 2023
Thank you!
Sulaymon Eshkabilov il 17 Feb 2023
Most welcome!

Accedi per commentare.

### Più risposte (1)

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))));
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)
.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Chebyshev in Help Center e File Exchange

R2022b

### Community Treasure Hunt

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

Start Hunting!

Translated by