Help with functions and Graphing

1 次查看(过去 30 天)
Hello Im am having issues calculating the sum Av dB. And Graphing this frequency rersponse of my filter. Its suppuse to be a chebyshev filter but, its just flat-lining.
%Gain
N_freq = length(fs);
Av_k = zeros(N_freq,N_Stages);
%Gain
N_freq = length(fs);
Av_k = zeros(N_freq,N_Stages);
N_freq = length(fs)
Av_k = zeros(N_freq,N_Stages);
for kk =1:N_Stages;
[Av_kk] = EE322_TF(fs,G_new,C_new);
Av_k(:,kk)= Av_kk;
end
%Total Gain
Av_k_dB = 20*log(Av_k);
Av_db = sum(abs(Av_k_dB))
figure()
freqz(Av_db,100,fs)
%}
%-----------------------------------------------------------------------
function [Av_kk] = EE322_TF(fs,G_new,C_new);
s=j*2*pi*fs;
G1=G_new(1);
G2=G_new(2);
G3=G_new(3);
C1=C_new(1);
C2=C_new(2);
A0=-G1*G3;
B2= C1*C2;
B1=(G1+G2+G3)*C2;
B0=(G2*G3);
[Av_kk]= (A0)/(B2.*s^2+B1.*s + B0);
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Extend Modeling Environment 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by