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 CenterFile Exchange에서 App Building에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by