Mathcad Example Using Decibels

Quote of the Day

I learned filmmaking by studying the Old Masters - and by that I mean John Ford, John Ford and John Ford.

— Orson Welles


I have been working on a software requirements document that involves optical power levels. I thought it might be worthwhile showing you how I use Mathcad as part of my requirements analysis process. This particular example shows how I computed the minimum optical power levels that a circuit will need detect. I used decibels for the calculations, which are not like standard "multiplicative units". Decibels are not really a unit -- they are more of a scaling. However, Mathcad handles decibels very cleanly.


Decibel Basics

The Mathcad folks recommend defining special functions for doing dB and dBm conversions and that is exactly what I do. Figure 1 illustrates the definitions I used in this analysis.

Figure 1: Defining a Set of Decibel Units.

Figure 1: Defining a Set of Decibel Units.

Optical Power Basics

P0 and P1 Power Levels

Binary digital communication systems work by sending streams of bits (0s and 1s) across a communications channel. These bits have to be transferred in a form that is compatible with the channel. In the case of copper wire-based systems, we use current or voltage. In the case of fiber optic systems, we use optical power to represent the 0s and 1s. I will assume that we are using "positive logic", which means that the power used to represent a logic 1 (called P1) is higher than the power used to represent a logic (called P0). Unfortunately, measuring P0 and P1 directly requires expensive test equipment (e.g. oscilloscope with optical probe).

Because this measurement is expensive, we define two alternative parameters, average power and extinction ratio. Average power is easy to measure, which makes it the most commonly reported optical parameter. Extinction ratio is difficult to measure (i.e. also requires an oscilloscope and optical probe), but it provides us additional information as to degree of wavelength purity we will see in the laser output (i.e. smaller extinction ratio means less optical power off of our desired wavelength).

Average Power

Many inexpensive handheld instruments do a fine job of taking an average power measurement. The definition of average power is P_{Ave}=\frac{P_0+P_1}{2}, assuming that P0 and P1 are equally probable. The measurement instrumentation involved is pretty straightforward:

In most cases, the average power measurement will give us enough information to understand the condition of the fiber network (e.g. ensuring that the loss levels on the plant are within specification).

Extinction Ratio

The extinction ratio is defined as \epsilon = \frac{P_1}{P_0}. I do not know of an easy way to measure extinction ratio. It is usually measured with oscilloscope with optical probe. However, the extinction ratio is important because lasers work best with lower extinction ratios. High extinction ratios (>10) cause problems like:

  • chirp

    High extinction ratio means that charge density inside the laser's optical channel is varying greatly. This can change the effective index of refraction within the channel and will cause the laser's wavelength to change during the transmission. This is bad because a varying wavelength causes dispersion.

  • overshoot/undershoot

    High extinction ratio means that the laser is driven hard on and off. This can mean that the power level will overshoot its P1 or undershoot its P0 level. Overshooting the P1 level is bad because it be difficult for the receiver circuit to deal with the widely varying signal level. Undershooting the P0 level usually means driving the laser below threshold (i.e. the laser stop lasing). This can result in some bizarre problems, including very slow laser switching speeds.

Formulas for Translating Between (P0,P1) and (\epsilon, PAve)

Figure 2 shows how you can use the definitions for PAve and \epsilon to compute P0 and P1.

Figure 2: Deriving Equations for P1 and P2 in Terms of Extinction Ratio and Average Power.

Figure 2: Deriving Equations for P1 and P2 in Terms of Extinction Ratio and Average Power.

PON Basics

Most of my work involves Passive Optical Networks (PONs). The details of the PON are not important to understand the gist of the post. It is important to know that there are two common types of PON (I am only concerned in this example with ONT-to-OLT receive power levels):

  • B+
    • PON loss is 28 dB
    • ONT PAve= 2.5 dBm
    • ONT \epsilon= 10\text{ dB}
  • C+
    • PON loss is 32 dB
    • ONT PAve= 2.5 dBm
    • ONT \epsilon= 10\text{ dB}

Figure 3 shows the loss model I used for this post.

Figure 3: Upstream PON Power Model.

Figure 3: Upstream PON Power Model.



Figure 4 shows how I calculated the 0 and 1 levels at the OLT receiver for a B+ PON.

Figure 4: Determining the Power of the "0" and "1" Levels for a B+ PON.

Figure 4: Determining the Power of the "0" and "1" Levels for a B+ PON.


Figure 5 shows how I calculated the 0 and 1 levels at the OLT receiver for a C+ PON.

Figure 5: Determining the Power of the “0″ and “1″ Levels for a C+ PON.

Figure 5: Determining the Power of the “0″ and “1″ Levels for a C+ PON.


I just wanted to show folks how I document my requirements work using Mathcad. I do this sort of analysis every day.


This entry was posted in General Mathematics, optics. Bookmark the permalink.

8 Responses to Mathcad Example Using Decibels

  1. Bruce Dai/China says:

    a very good artical, easy to understand, I'm looking for a subsititude equipment of the Anristsu MP2100, but so far it seems that there is no such kind tools..

  2. Dave Miller says:

    I like it. I was looking for a nice way to handle db in Mathcad and this helped.


  3. Wilton Alston says:

    How does one enter the convert-back equations? Cannot figure out how to do that part! Using PTC MathCAD Express, if that matters.

    • mathscinotes says:

      I am not sure what you mean by "convert-back"? I defined functions for number-to-dB conversion dB) and dB-to-number conversion (/dB). Could you give me a specific example?


      • Wilton Alston says:

        Sorry, what I have no idea how to enter is the dB-to-number (/dB) conversions. Specifically, what is the keystroke combination that leads to that? (It may very well be that my version of MathCAD does not support this functionality, but I figured I would ask anyway!) I appreciate your response.

        • mathscinotes says:

          I have not tried Mathcad express, and I assume you can define functions in it. In Mathcad 15, which I use at work, you can define a function to convert a number into dB. dB is not a unit – it really is a nonlinear scaling.

          In my example, I used a function named "/dB". Because the / character is reserved, you need to type Ctrl-Shift K to get into "text in math" mode. You can change the name from /dB to some other name, cdB (convert dB). That works just as well and is easier to type.

          Go into your Mathcad Help and lookup "variable names" to see what is legal.


          • Wilton Alston says:

            Yes, I suspected as much. When I type "/dB" it places dB under a line, as if one were dividing by dB. So, doesn't work like what you're using. Again, I appreciate your help, and your putting your "tips" out here for us to use! All the best.

  4. Ali says:

    When I try to create a user function for dB after declaring dB as dB:=1, I get a warning about redefinition of the dB symbol. I must be doing something wrong because the expression a:=1dB then errors out with dB as not defined.
    I have looked online and turned up empty handed. Any help would be appreciated.


Leave a Reply

Your email address will not be published. Required fields are marked *