How to convert logarithmic to linear

조회 수: 103 (최근 30일)
Moza Mohamed
Moza Mohamed 2021년 9월 20일
답변: Star Strider 2021년 9월 20일
I use rfplot to plot magnitude of s-parameters in db, if i want to plot the s.parameters in linear form how can i do this ?
s=sparameters("C:\Users\Moza Salem Mohamed\OneDrive\Desktop\MM\Lab 2\emptyCell.s2p")
figure
rfplot(s,1,1)
hold on
rfplot(s,2,1)
title("Empty Cavity (Log)")
hold off

답변 (2개)

KSSV
KSSV 2021년 9월 20일
Take exp of the result. The inverse of log is exp,

Star Strider
Star Strider 2021년 9월 20일
If you have the Signal Processing Toolbox, use the db2mag function.
If you do not have it:
dB2mag = @(dB) 10.^(dB/20); % Note: Capital 'B'
mag = 100;
dB = mag2db(mag)
mag = dB2mag(dB)
Since MATLAB is case-sensitive, the ‘dB2mag’ anonymous function will not overshadow any of the db2mag functions in the Toolboxes. (The exp function will not work in this instance, since decibels are defined in terms of base-10 logarithms.)
.

카테고리

Help CenterFile Exchange에서 Data Import and Network Parameters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by