diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-04-13 12:05:12 -0700 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-04-15 07:44:19 -0500 |
commit | d90e8a91fd37e49dad36cf8fc890a08494d979c2 (patch) | |
tree | 64308e12cca712a91c7adfb9d6999b60abb4212c /host/utils/setup.py.in | |
parent | dd695fb1670beacef0ac2e5e989720d9727b1ede (diff) | |
download | uhd-d90e8a91fd37e49dad36cf8fc890a08494d979c2.tar.gz uhd-d90e8a91fd37e49dad36cf8fc890a08494d979c2.tar.bz2 uhd-d90e8a91fd37e49dad36cf8fc890a08494d979c2.zip |
examples: wavetable: Modify wave tables to ease power calculations
The existing implementation would create a real signal for any type of
signal (CONST, RAMP, SQUARE, and SINE), and then create the complex
signal by simply delaying the Q value by a 90 degree phase. This had
surprising results for all waveforms:
- CONST waveforms would have a baseband value of ampl + j ampl, thus
increasing the output power by 3 dB vs. what one would expect when
setting an amplitude. It is now ampl + j * 0, and the power is
ampl**2. This now makes the power consistent with SINE, which it was
not, even though a const signal is a sine signal with a frequency of
zero.
- SQUARE waveforms would phase-delay the Q part, thus resulting in three
power output levels (when both phases are zero, when both phases are
ampl, and when one of them is zero and other is ampl). However, the
square signal is useful for watching it in the scope, and there, it
helps if the power is predictably either high or low within the
selected frequency. The Q value is now always zero.
- RAMP waveforms had the same issue and were also resolved by setting
Q to zero.
- SINE signals were fine, although the implementation used sin + j cos
to calculate a complex sine, not cos + j sin according to Euler's
formula.
To make this wavetable more useful with absolute power settings, the
changes mentioned above were implemented. The dBFs power of CONST and
SINE can now be calculated by using ampl**2, SQUARE by using
(ampl**2)/2, and RAMP by solving the integral over a ramp from -1 to 1.
Diffstat (limited to 'host/utils/setup.py.in')
0 files changed, 0 insertions, 0 deletions