diff --git a/pcb_calculator/transline/stripline.cpp b/pcb_calculator/transline/stripline.cpp index 4aebc7f3eb..aff5741d24 100644 --- a/pcb_calculator/transline/stripline.cpp +++ b/pcb_calculator/transline/stripline.cpp @@ -30,9 +30,6 @@ #include "stripline.h" #include "units.h" -// const to convert a attenuation / loss from log to decibel -const double LOG2DB = 20.0 / log( 10.0 ); - STRIPLINE::STRIPLINE() : TRANSLINE() { m_Name = "StripLine"; @@ -41,7 +38,7 @@ STRIPLINE::STRIPLINE() : TRANSLINE() // ------------------------------------------------------------------- -// calculate characteristic impedance and conductor loss (in log/meter) +// calculate characteristic impedance and conductor loss (in db/meter) double STRIPLINE::lineImpedance( double height, double& ac ) { double ZL; @@ -98,7 +95,7 @@ void STRIPLINE::calcAnalyze() m_parameters[Z0_PRM] = 2.0 / ( 1.0 / lineImpedance( 2.0 * a + t, ac1 ) + 1.0 / lineImpedance( 2.0 * ( h - a ) - t, ac2 ) ); - m_parameters[LOSS_CONDUCTOR_PRM] = LOG2DB * m_parameters[PHYS_LEN_PRM] * ( ac1 + ac2 ); + m_parameters[LOSS_CONDUCTOR_PRM] = m_parameters[PHYS_LEN_PRM] * ( ac1 + ac2 ); m_parameters[LOSS_DIELECTRIC_PRM] = LOG2DB * m_parameters[PHYS_LEN_PRM] * ( M_PI / C0 ) * m_parameters[FREQUENCY_PRM] * sqrt( m_parameters[EPSILONR_PRM] ) diff --git a/pcb_calculator/transline/units.h b/pcb_calculator/transline/units.h index 6bd42bedbe..255dc68388 100644 --- a/pcb_calculator/transline/units.h +++ b/pcb_calculator/transline/units.h @@ -61,6 +61,10 @@ inline double atanh( double x ) #define C0 299792458.0 // speed of light in vacuum #define ZF0 376.730313668 // wave resistance in vacuum +// const to convert a attenuation / loss from log (Neper) to decibel +// (1 Np = 8.68589 dB) +const double LOG2DB = 20.0 / log( 10.0 ); + // ZF0 value update: // https://physics.nist.gov/cgi-bin/cuu/Value?z0