summaryrefslogtreecommitdiff
path: root/gr-blocks
Commit message (Collapse)AuthorAgeFilesLines
...
* gr-blocks: Add scaling option to Complex to/from ishort and icharghostop142020-02-2019-96/+157
| | | | | | | | | | | | | | | The existing block combinations of complex-to-ichar/ichar-to-complex and complex-to-ishort/ishort-to-complex was not exposing a scale factor to the UI (it was hard-coded at 1.0) which prevented the blocks from being used with voltage-based inputs and outputs, for example a -127 to 127 byte input would be mapped directly to the same value as a float. The same was true in reverse and there were notes in the code about FIX clipping. Adding the scale factor provides a mechanism for the user to appropriately fix the clipping and scale the conversion correctly. Additional documentation was added to the block yml to provide guidance to users on how to appropriately select the scale factor for their use case, and the default value was set to 1.0 for backward compatibility.
* blocks: support saving of all tags on tag debugIgor Freire2020-02-183-9/+40
| | | | | | | | | | For testing, it is often useful to check all tags ever received, rather than solely the tags from the last call to the Tag Debug's work function. This patch adds this option and a public method for activating it. This is more appropriate for controlled test environments, where the vector of tags is known not to grown indefinitely. Hence, the option is not exposed as a block parameter.
* grc: Fix C++ code generationTerry May2020-02-183-4/+7
| | | | | | | | | | | | | | | | | | | | | | | - Added support for C++ std::map<> from python dict - Fixed default initialization of parameters in main() - Added missing include for realtime scheduling - Added default CMake option for std=c++11 as this is required for gnuradio >= 3.8 - Fixed mako template to add initialization to parameter declarations in main() - Fixed C++ constructor initialization list generation - Fixed parameter type determination when an lvalue is used in an rvalue expression - Improved determining type of C++ variables - Added C++ support for gr_complex parameters - Fixed C++ generation of nested container types - Added C++ support for virtual source/sink - Moved cmake CMAKE_CXX_STANDARD 11 option from options.yml to CMakeLists.txt.mako - Fixed qtqui_sink to allow multiple instances - Revised virtual connection processing in cpp_top_block.py Reviewed-By: Håkon Vagsether <hauk142@gmail.com>
* Blocks: Add DC Spike Removal and IQ Swap Native Blocksghostop142020-02-1520-0/+1101
| | | | | | | | | | | | This block incorporates the OOT modules in correctiq that provide 3 different techniques to remove the DC spike inherent in IQ sampling. The first technique mirrors SDR GUI receivers with an IIR filter approach, the second provides a time-limited IIR approach where after a user-configurable number of seconds locks into a basic offset correction to eliminate the effect of the filter on the signal while maintaining the correction, and the last is manual I and Q configurable offsets. The Swap IQ block is a drop-in block to help correct for inverted spectrums and just swaps I<->Q.
* gr-blocks Add Msg to Var and Var to Msg Conversion Blocksghostop142020-02-1512-0/+542
| | | | | | | | | | | | | | | | These 3 new blocks provide the missing glue to move between messages and variables in the same flowgraph. There are 3 variants here: 1. Monitor a variable and produce a user-specified message (pair) when the variable changes. Useful bridging standard GUI controls to message-based blocks. 2. When an inbound message (pair) is received, update a specified variable. 3. When an inbound message (dict) is received, extract a single dictionary entry and produce a message pair (useful if you have a multi-value dictionary but you just want to pull off a single attribute such as frequency or gain without modifying the upstream block. This can be paired with (2) if necessary to move from a dictionary item to a variable.
* runtime/math: unclutter GR_M_ math constant definesMarcus Müller2020-02-141-4/+4
| | | | | | * no speed advantage of GR_M_TWOPI: every compiler pre-computes constants, so that (2 * GR_M_PI) is just as fast * rest of constants not even used
* gr-digital: Improve Performance of Costas Loopghostop142020-02-142-25/+21
| | | | | | | | | | | | | This update is focused on improving the throughput of the Costas loop, however some changes are more global performance enhancements as this PR has evolved. Updates include an ENABLE_NATIVE added to CMake, which is off by default but enables native compiling (including FMA support) if desired; sincos was inlined in sincos.h and sincos.cc was removed from the appropriate CMake to improve sincos speed, some constants were added to math.h, inlined functions in costas loop and nco.h, used switch instead of function pointer (much faster), and used fast complex multiply to get around all the range checking in the standard complex.h complex multiply function on all builds.
* grc: add python snippets to GRCJosh Morman2020-02-102-0/+291
| | | | | | | | | | | This feature adds the ability to insert arbitrary code into the python flowgraph. It gives a little more low-level flexibility for quickly modifying flowgraphs and adding custom bits of code rather than having to go and edit the generated py file One example is synchronizing multiple USRP objects - sometimes you want different sync than what is offered in the multi-usrp object, so you can put a bit of code in the snippet block to do the custom synchronization
* pmt: Fix RuntimeError in pmt_to_pythonMichael Byers2020-02-092-15/+15
| | | | | | | Python has a RuntimeError that's thrown during the pmt to_python function. Instead of throwing this error, SWIG has been updated to throw a TypeError. This allows us to keep the same behavior whereby we iterate over PMT types until the proper conversion is found
* runtime: release the flattened flowgraph after stoppingClayton Smith2020-02-081-0/+30
|
* gr-blocks: add tests for throttleClayton Smith2020-02-041-4/+45
|
* gr-blocks: copy samples before sleeping in throttleClayton Smith2020-02-041-5/+6
|
* gr-blocks: use monotonic clock for throttleClayton Smith2020-02-042-17/+17
| | | | | | To ensure that the throttle block operates normally even if the system clock changes, I've switched it to use std::chrono::steady_clock, which is a monotonic clock.
* Update license header to SPDX formatdevnulling2020-01-27590-7671/+592
|
* blocks: Add show_id flag to Probe Signal VectorHåkon Vågsether2020-01-261-1/+1
|
* blocks: Add show_id flag to Probe SignalHåkon Vågsether2020-01-261-1/+1
|
* Rotator-based Freq Shift Convenience Wrapperghostop142020-01-251-0/+34
| | | | | | | | | | | | This yml adds a convenience-wrapper block to provide volk-accelerated frequency shifting based on the rotator block that doesn't require the user to "import math" and code the "2Pifreq/samp_rate" as the phase increment. I don't think newbies know a rotator with a phase increment results in a frequency shift (I didn't for the longest time) and may be relying on less CPU-efficient means such as a signal source/multiply or a frequency xlating fir filter (the latter one-sample-at-a-time rotates as it decimates rather than leveraging volk to do a block).
* Added in/out selector msg portsghostop142020-01-243-1/+54
| | | | Input and output port selection can now be controlled by messages.
* examples: fixup cmake files to include all examplesdevnulling2020-01-224-1/+12
|
* blocks: matrix multiplier example flowgraph chooser bugfixJosh Morman2020-01-211-23/+56
| | | | | | | | | The default values in the chooser changed in a previous commit so it did not translate properly to this flowgraph There are probably more flowgraphs that will be affected by this Fixes #3027
* blocks/file_source: Check for fseek() failingThomas Habets2020-01-201-3/+9
| | | | | | Found by coverity. CID: * 1395913 * 1395940
* blocks/tagged_file_sink: Add const and enum type safetyThomas Habets2020-01-202-13/+14
| | | | Found by coverity. CID 1043276
* Fix all formatting issuesMartin Braun2020-01-105-10/+6
| | | | | This fixes every leftover file in the GNU Radio source tree to match our clang-format definition.
* blocks: add example flowgraph for tagged_file_sinkJosh Morman2020-01-061-0/+220
| | | | | Simple flowgraph to start and stop via a checkbox the saving of a file to the tagged file sink block
* gr-blocks/unpacked_to_packed: Remove needless castThomas Habets2020-01-061-1/+1
|
* Change some ints to unsigned intThomas Habets2020-01-061-1/+1
|
* gr-blocks: More constThomas Habets2020-01-0610-17/+17
|
* gr-blocks/packed&unpacked: More constexprThomas Habets2020-01-063-15/+15
|
* gr-blocks/packed&unpacked: Add constThomas Habets2020-01-064-15/+15
|
* gr-blocks: Make d_vlen constThomas Habets2020-01-0634-34/+34
|
* gr-blocks: VOLKize add_const_ff implementationGrant Cox2020-01-046-30/+32
| | | | | | | | | | | | - Use volk_32fc_x2_add_32fc to volk add constants to the input vector of the block - use volk::vector in add_const_ff_impl: Rather than using float* for variable length vector addition in volk, use volk::vector<float> for easier resizing. - Use scoped_lock when modifying private data members in add_const_ff_impl.cc. Remove getter functions for the d_k_copy vector. Cast with static_cast rather than typical cast. Use vector.data() rather than &vector[0].
* Replace many `const` variables with `constexpr`Thomas Habets2020-01-043-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constexpr is like const but (for variables) guarantees evaluation at compile time (as opposed to runtime). Likely this change will do nothing on its own (though it could, since it gives the compiler more information). But it still has benefits. It allows programmer to know that initialization is not expensive (it was done at compile time), and reduces risk of a refactoring regressing the compiletimeness. Runtime initialization can be nonobvious in larger codebases. E.g.: struct S { static int foo(); }; const int bar = S::foo(); // Called and initialized at *runtime*. int S::foo() { return 10; } With constexpr: struct S { static constexpr int foo(); }; constexpr int bar = S::foo(); // Error: used before definition. constexpr int S::foo() { return 10; } Initializing at runtime is not just startup costs, but also can save memory since it'll end up in a R/O section of a binary and therefore doesn't need to be swapped out, but can be shared (in the mmap() sense of the word).
* SimpleXMLRPCServer was moved in Python3Johannes K Becker2020-01-041-2/+2
|
* message_strobe_random: replace boost::random with C++11Marcus Müller2020-01-022-60/+38
|
* message_strobe_random: inexplicable includes removedMarcus Müller2020-01-021-8/+0
|
* random_pdu: random facilities use C++11 (minus boost)Marcus Müller2020-01-022-10/+7
|
* gr-blocks/file.*: Remove needless memory managementThomas Habets2020-01-023-13/+9
|
* gr-blocks/pack&unpack: Remove needless memory managementThomas Habets2020-01-024-14/+8
|
* digital/blocks: Remove broken/unnecessary C++ sizeof translationTerry May2020-01-0237-68/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Several components use the following translation in cpp_templates: ``` translations: gr.sizeof_: 'sizeof(' ``` The problem is the generated code is missing a closing parens i.e.: this->blocks_delay_0 = blocks::delay::make(sizeof(gr_complex*1, 0); This could be fixed by adding a closing parens in the make template, but it looks awkward to have an unmatched closing parens. And only a few blocks currently have this closing parens added. Most of them produce erroneous code like that above. However, this sizeof translation is not even needed in the YAML file because cpp_top_block.py explicitly adds the proper sizeof translation. ``` translations.update( {r"gr\.sizeof_([\w_]+)": r"sizeof(\1)"} ) ``` So removing this translation all together produces correct code for blocks that use gr.sizeof_X.
* Remove newlines from exception messagesThomas Habets2020-01-014-12/+12
|
* Use C++11 ranged for and ranged insert instead of manual loopsThomas Habets2019-12-0412-46/+27
|
* Use 'const' on more member variablesThomas Habets2019-12-043-3/+3
|
* put back checks for io.h in cmake files #2874Grant Cox2019-11-071-0/+1
|
* Remove circular_file.cc from codebase, cmake, qa, and ConfigChecks #2874Grant Cox2019-11-071-1/+0
|
* blocks: transcendental: Default to complex_float in GRC bindingsMartin Braun2019-11-011-1/+1
| | | | | The default is complex_double, or float. The former is rarely used in GNU Radio, hence, it is not a good default.
* ctrlport: qa use new apiBastian Bloessl2019-08-283-14/+7
|
* Fix memset clearing non-trivial type gr_complex warnings in gcc-8Anders Kalør2019-08-221-2/+3
| | | | | | | | Using memset with gr_complex is not a problem since the underlying representation of gr_complex is guaranteed to be two floats in adjacent memory locations without padding or additional memory. Fixes #2743
* runtime: update flaky qa test to 3.8 schedulerBastian Bloessl2019-08-221-7/+1
|
* clang-tidy in gnuradio-runtime: use empty() instead of size()!=0Marcus Müller2019-08-2210-14/+14
|
* Use emplace_back(params) instead of push_back(type(params))Marcus Müller2019-08-228-51/+50
| | | | | | | | | | | | | | | | | | | This is C++11: you can convert std::vector<complextype> vec; vec.push_back(complextype(foo, bar, baz)); by std::vector<complextype> vec; vec.emplace_back(foo, bar, baz); which saves one unnecessary copy. This mostly happened in rpc code. The automated clang-tidy check failed miserably, so most of this was done by hand.