Help with functions and Graphing

1 回表示 (過去 30 日間)
Trevon Alvarado
Trevon Alvarado 2020 年 4 月 21 日
編集済み: Trevon Alvarado 2020 年 4 月 21 日
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 Center および File ExchangeApp Building についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by