Plot magnitude of reflection coefficient in linear and db scale, vswr

조회 수: 17 (최근 30일)
Good afternoon,
I have a hw problem that requires me to plot the reflection coefficent in linear, db scale,and vswr so far I have these lines of code.
C=8.34E-12;
L=15E-9;
zo=50;
zin=50+((1/1i*C)+1i*L);
f=linspace(200E6,1E9);
w=2*pi*f;
gamma=((zin-zo)./(zin+zo));
agamma=abs(gamma);
db=10*log10(abs(agamma)^2);
vswr=(1+agamma)/(1-agamma);
plot(db,f)
plot(w, vswr)
plot(w,gamma)
I have errors and its saying imaginary parts are ignored.

채택된 답변

Star Strider
Star Strider 2020년 2월 25일
편집: Star Strider 2020년 2월 25일
Use the linspace function to create the ‘f’ vector:
C=8.34E-12;
L=15E-9;
zo=50;
zin=50+((1/1i*C)+1i*L);
f=linspace(200E6,1E9);
gamma=((zin-zo)./(zin+zo));
agamma=abs(gamma);
w=2*pi*f;
figure
plot(f,agamma)
I suspect that ‘zin’ should instead be:
zin=50+(1./(1i*C)+1i*L);
and likely also needs to be a function of ‘w’. I leave that to you.
(When I made the necessary other corrections and ran your code, there appears to be a match at 450 MHz.)
EDIT — (20 Feb 2020 at 20:36)
The imaginary parts are ignored in the plot if you plot ‘gamma’. If you instead plot ‘agamma’ there is no problem.
For that reason, also use ‘agamma’ when you calculate the values in dB.
  댓글 수: 2
Nicholas Barker
Nicholas Barker 2020년 2월 28일
편집: Nicholas Barker 2020년 2월 28일
Much appreciated, I got all graphs figured out and found resonant frequency

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Analysis, Benchmarking, and Verification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by