필터 지우기
필터 지우기

Alternative ways to plot a bode diagram

조회 수: 13 (최근 30일)
francesco capirci
francesco capirci 2017년 1월 23일
I'm trying to make a Bode diagram of a function. The problem is that said function contains a (j*w)^n inside, where (0.87 < n < 0.93). That means that i cannot use the bode function, the way that works i need all s to have an integer exponential. I tried to use semilog plot:
if true
%defining logspace
f = logspace(0,6,1e6);
w = 2*pi*f;
%the impedance which contains the (j*w)^n
Zel = Rct./(1 + Rct*(1j*w*Cdl).^n);
% defining H
H_num = Rseal*Zload;
H_den = Rseal*Zm + (Zm + Rseal)*(Zload + Zel);
H=H_num./H_den;
%plotting the bode diagram
subplot(2,1,1)
semilogx(f, 20*log10(abs(H)))
subplot(2,1,2)
semilogx(f,unwrap(angle(H))*180/pi)
end
and yet the result was off, while i got a high pass filter as it should be, it was wrong.
this is the result i was expecting:
I tried with symbolic functions too:
if true
% code
syms s f;
s= 1j*(2*pi*f);
H_num = Rseal*Zload;
H_den = Rseal*Zm + (Zm + Rseal)*(Zload + Zel);
H=H_num/H_den;
H_modulo = matlabFunction(20*log10(abs(H)));
H_fase = matlabFunction(radtodeg(phase(H)));
end
and this time i got this, still wrong:
So, while i triple check the values of the parameters and the calculations, someone has any idea of why this isn't working? or just a suggestion on where to look. Thanks in advance for you help.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by