[hpsdr] Level calculation error in Two Tone Test generation routine

Warren C. Pratt warren at wpratt.com
Wed Nov 23 18:47:47 PST 2016


Hi John,

As you perhaps know, I wrote all the DSP software we are using, 
including the signal generator code and the code snippet you 
referenced.  So, should there be an issue, I would be the one to deal 
with it.  Perhaps I can provide some additional information for 
clarification and as food for thought to facilitate our discussion.

First of all, the openHPSDR/Apache-Labs transmitter/transceiver boards 
(with the exception of the original Penelope board of some years ago) 
use the DAC bias current as the final control on power output.  When you 
adjust the 'Drive' control, you are adjusting the DAC bias current, not 
the I/Q levels.  This allows us to use all DAC bits, independent of 
power level.  (There is still a special path in the software to support 
the original Penelope board by multiplying I-Q by a value based upon 
Drive setting.)

The numbers you referenced in the code snippet (~0.5 at the 0dB 
generator setting), DO directly translate to I-Q values.  So, if you 
have two tones with peak magnitudes of 0.5, when their peaks coincide, 
you have I or Q of 1.0.  1.0 is the MAXIMUM value that can be 
transferred from software to firmware and subsequently to the DAC.  This 
double-precision floating point number is converted to an integer for 
the transfers and the 1.0 value equates to the maximum possible value in 
the integer space.  So, from a pragmatic numerical perspective, I could 
not increase the numbers as you suggest without wraparound in the 
integer space and resulting severe distortion and broadband spurious 
products.

How much the final amplifier is or is not driven into 
compression/saturation depends upon several things:  (1) the I-Q levels 
which vary with modulation and are also controlled by the settings of 
the two-tone generator, (2) the Drive control which controls the DAC 
bias current, and (3) the gain characteristics of the various analog 
amplifier stages.

Now, consider some various outgoing signals:

* Single-tone (like TUN signal):  I and Q each are driven to a 1.0 
maximum value.  This yields a constant (and peak) envelope of 1.0. 
(envelope = sqrt(I^2+Q^2))

* Two-tone:  I and Q are each driven to a 0.5 maximum value. This yields 
a PEAK envelope of 1.0.  Obviously the AVERAGE is considerably lower as 
sometimes the tones "subtract" rather than "adding".

* SSB / AM Modulation:  The ALC ALWAYS limits the peak envelope 
amplitude to 1.0.

In all cases, we are driving to the SAME PEAK ENVELOPE LEVEL.

Per the two-tone 0.5 factor we've been discussing, it's obvious that the 
power of each tone will be 6dB lower than the peak two-tone power.  This 
is consistent with both the mathematical analysis I referenced yesterday 
and with what you can observe on the panadapter.    However, the peak 
envelope power is at the maximum level provided by a TUN tone or an SSB 
signal.

As far as the ARRL test, note that the maximum rated transmitter power 
is a PEP rating, not an average rating.  It's also worthy of note that 
the ARRL references their test result to peak power, rather than the 
power in either tone.  It is well-known that their test results are 6dB 
more favorable than those from other labs --- the 6dB peak to average ratio.

You stated in your message:

"When you apply a single CW(non-pulsed) tone at a given power level to 
an amplifier and add a second tone at the same power level it will 
double the output power or put another way it will increase the power by 
3dB."

When you add the second tone at the same power level, the PEAK ENVELOPE 
POWER quadruples (6dB) ... it is this peak envelope that defines the top 
of the gain curve of the amplifier and is equal to the peak envelope 
power in other modes of operation.

73,

Warren  NR0V



More information about the Hpsdr mailing list