Thursday, December 17, 2015

dB vs. dBW vs. dBm Tutorial

Alexander Graham Bell, after which the bel,
and therefore the decibel, is named.


The decibel (dB) is a dimensionless unit used for quantifying the power ratio between two values. The unit is useful for describing the gain or loss in a system. It is used when characterizing amplifiers, attenuators, mixers, or RF chains as a whole. It is based on the bel and is defined as follows:

A power ratio is defined as:

power ratio = ouput_power / input_power

A bel is defined as:

power in bels = log10(output_power / input_power)

A decibel is 1/10 as large as a bel so ten decibels make up one bel:

1 bel = 10 decibels

And therefore power in decibels is defined as:

power in decibels = 10 * log10(output_power / input_power)

The table below shows the loss/gain as a power ratio compared to the loss/gain in decibels for several different values:

The table below shows a amplitude ratio, power ratio (which is just the amplitude ratio squared), and associated dB value. Note that the dB range for corresponding power ratios is much smaller, i.e, -100 dB to +100 dB corresponds to 0.0000000001 to 10000000000 power range. That makes the use of dBs desirable when dealing with large power ranges. An example would be a satellite communications system where transmit antenna signal power is +14 dBW and receiver antenna signal power is -160 dBW.

dBpower ratioamplitude ratio
100  10 000 000 000100 000
901 000 000 00031 623
80100 000 00010 000
7010 000 0003 162
601 000 0001 000
50100 000316.2
4010 000100
301 00031.62
10 10
63.9811.995 (~2)
31.995 (~2)1.413
−30.501 (~1/2)0.708
−60.2510.501 (~1/2)
−100.10.316 2
−300.0010.031 62
−400.000 10.01
−500.000 010.003 162
−600.000 0010.001
−700.000 000 10.000 316 2
−800.000 000 010.000 1
−900.000 000 0010.000 031 62 
  −1000.000 000 000 10.000 01
An example scale showing power ratios x and amplitude ratios √x and dB equivalents 10 log10 x. It is easier to grasp and compare 2- or 3-digit numbers than to compare up to 10 digits.

As you can be seen from the table above, 1 dB is approximately 26% power gain, 3 dB is approximately 2× power gain, and 10 dB is 10× power gain. This is useful to know for "back of the envelope" power calculations.


dBW is an abbreviation for the power ratio in dB of the measured power referenced to one watt (1000 mW):

power in dBW = 10 * log10((output_power_watts) / 1W)

For 1mW of power, you get -30 dBW.

For 2mW of power, you get -27 dBW.

For 1W of power, you get 0 dBW.


dBm, also written as dBmW, is an abbreviation for the power ratio in decibels (dB) of the measured power referenced to one milliwatt (mW):

power in dBm = 10 * log10((output power in watts)/1mW) = 10 * log10((output power in watts) / 0.001)

For 1mW power, you get 0 dBm.

For 2mW power, you get about 3 dBm.

For 1W power, you get 30 dBm.

So doubling the power is equivalent to about a 3 dBm increase.

dBm to dBW Conversion

We know the following:

power in dBW = 10 * log10(output power in watts/ 1W) = 10 * log10(output power in watts)


power in dBm = 10 * log10(output power in watts/ 1mw) = 

                        10 * log10(output power in watts / 0.001) = 
                        10 * log10(output power in watts * 1/1000)

So we need to divide the dBW power ratio by 1000 to equate it to the dBm power ratio. But we know that 10 * log10(1/1000) is -30 dB. 

And since we know: 

log10(X * Y * Z) = log10(X) + log10(Y) + log10(Z) 

we can just subtract 30 dB from the dBm value instead of dividing the power ratio by 1000 to arrive at the dBW value. 

So for example, 50 dBm - 30 dB = 20 dBW.

Both dBm and dBW are used for measuring absolute power.


Wednesday, December 2, 2015

Matlab Standalone Installer How-To

I have a Windows 7 PC that does not have Internet access. I need to install Matlab on it but the Matlab website will not allow me to download a standalone installer. The only option they offer is to download a smaller installer that will then connect to their site and download and install Matlab.

Here's a little bit of backstory. As of R2014a, License End Users do not have the ability to download their software without installing it.  Currently, only the Administrator and the Asset Managers have the ability to download only or to download and install the software. With a little work I was able to achieve a workaround.

I've detailed the steps below to download the installer so that you can install Matlab on a PC that does not have Internet access.

Navigate to the Mathworks License Center:

Click "Activation and Installation"

Click "Activate"

Fill out the activation form with the information for the PC where you want to install Matlab. Download the License File and save the Activation Key to a text file. They'll be used for the standalone installation later on.

Next download Matlab by purchasing a license or using an existing one as shown below:


Which will bring you to the actual download page. Save the executable to a known location, in this example we'll be using the c:\downloads folder.

Once you've downloaded the executable, run it. It will extract files to a directory named c:\downloads\Matlab_R2015b_win32_Installer" or something similar depending on the version you've downloaded. This folder will be used later. 

Let the installer download and install Matlab on your PC. Don't worry about activation as you won't be using it on this PC anyhow. Once downloading is complete navigate to c:\downloads (or whatever download directory you used). There will be a directory in there called Mathworks. This directory contains Matlab installation files. These files will have to be combined with the files from the c:\downloads\Matlab_R2015b_win32_Installer directory to create the standalone installer. 

Copy all of the files from c:\downloads\Mathworks\archives\common\*.* to c:\downloads\Matlab_R2015b_win32_Installer\archives\common
Copy all of the files from c:\downloads\Mathworks\archives\win32\*.* to c:\downloads\Matlab_R2015b_win32_Installer\archives\win32

I like to keep my installers in c:\software. So I copied over the c:\downloads\Matlab_R2015b_win32_Installer folder to c:\software and renamed it to Matlab R2015b for simplicity.

Now you can burn the "Matlab R2015b" folder to a DVD / flash drive along with the Activation Key and License File downloaded above and you'll be able to install Matlab on a PC that doesn't have Internet access. Just click on the setup.exe file to launch the installer.