aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/wavetable.hpp
Commit message (Collapse)AuthorAgeFilesLines
* examples: Add --power command line option to tx_waveformsMartin Braun2020-04-171-0/+19
| | | | | | | | | | | | | | If you run tx_waveforms --power -20 [other args] it will try to set the out power to -20 dBm. The signal amplitude is factored in, so changing --ampl will not change the actual TX power unless it causes clipping, or becomes too low. If the USRP does not support setting a power, the program will terminate early. If it does support setting a power, but can't reach the requested power, it will coerce, and print the actual, available power.
* examples: wavetable: Modify wave tables to ease power calculationsMartin Braun2020-04-151-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-1/+2
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-091-6/+9
| | | | | | | | | | | Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
* uhd: mpm: apply clang-format to all filesBrent Stapleton2019-01-161-29/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying formatting changes to all .cpp and .hpp files in the following directories: ``` find host/examples/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/tests/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/utils/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find mpm/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Also formatted host/include/, except Cpp03 was used as a the language standard instead of Cpp11. ``` sed -i 's/ Cpp11/ Cpp03/g' .clang-format find host/include/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Formatting style was designated by the .clang-format file.
* examples: Fix some minor compiler warningsMartin Braun2018-02-191-2/+5
| | | | All warnings reported by MSVC. Mostly related to narrowing conversions.
* uhd: Update license headersMartin Braun2018-02-191-1/+2
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* examples: Whitespace and other cleanupMartin Braun2014-10-281-0/+66