summaryrefslogtreecommitdiff
path: root/gr-blocks/include/gnuradio
Commit message (Collapse)AuthorAgeFilesLines
* blocks: document the supported operations in transcendentalMarcus Müller2022-01-031-0/+19
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* blocks: Throttle consume-only modeMarcus Müller2021-07-191-0/+8
| | | | | | | | | When throttling a sample flow, it's not necessary to produce items at the desired average rate - consuming them at a limited rate suffices to slow down the processing of the whole flow graph just as well, and avoids a copy. Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* blocks: zero-output, zero-copy Head modeMarcus Müller2021-06-281-2/+9
| | | | | | | | | If you don't want to test a stream with an exact number of input, but just want your flow graph to terminate after a given number of items, having a head block without an output enables you to do that without copying the data from Head's in- to its output. Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* global: automatically remove unused boost includesMarcus Müller2021-06-221-1/+0
| | | | | | | | used command: sed -i '/^#include.*boost.*$/d' $(ag -L '(boost::|BOOST)' $(ag --cpp -l '#include <boost')) Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* blocks: use VOLK popcnt implementations for count_bitsNicholas Corgan2021-05-131-1/+3
| | | | | | * Changed count_bits64 input parameter type to uint64_t Signed-off-by: Nicholas Corgan <n.corgan@gmail.com>
* blocks: remove deprecated network blocksJosh Morman2021-04-214-200/+0
| | | | Signed-off-by: Josh Morman <jmorman@perspectalabs.com>
* blocks: Add msg port to set rotator's phase incIgor Freire2021-04-171-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Receivers commonly estimate the frequency offset on a block that is downstream relative to the frequency correction NCO. In such architectures, typically the frequency offset estimator feeds the estimation back to the NCO. Until now, this was not possible if using the rotator block as the NCO. This patch adds a message port to the rotator block such that the referred feedback architecture becomes feasible. A downstream block can estimate the frequency offset and send a message to the rotator block to update its rotating frequency (i.e., its phase increment). The requesting block can schedule the phase increment update to a specific absolute sample index. This feature is useful for receivers that rely on a frame structure and pilot-aided frequency offset estimation. If the true frequency offset is allowed to change at any random instant throughout the frame, the frame-averaged frequency offset estimation can become less reliable. Instead, it is often better to update the frequency correction right at the start of a new frame. With that, the true frequency offset is preserved in the course of a frame and only changes around the boundary between consecutive frames. For flexibility when using this feature, it is the responsibility of the downstream block to schedule the phase increment update properly. For example, if there is a decimator in between the rotator block and the frequency offset estimator, the latter will need to take the sample rate conversion into account when defining the absolute sample offset when the update should be applied. Besides, the rotator block can now place a tag on the sample where it updates the phase increment. This allows a downstream block to better calibrate and validate the scheduling of phase increment updates. Signed-off-by: Igor Freire <igor@blockstream.com>
* blocks: message_debug: vector indices are size_t, not signed intMarcus Müller2021-03-231-2/+2
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* gr-blocks: remove pdu blocksJacob Gilbert2021-03-1810-393/+0
| | | | | | | | | | | | | | | | | | | | | | | | The following have been moved to the new gr::pdu module or to gr::network and are no longer needed in gr::blocks: - pdu (noblock) - pdu_filter block - pdu_remove block - pdu_set block - pdu_to_tagged_stream block - random_pdu block - socket_pdu block - stream_pdu_base (noblock) - tagged_stream_to_pdu block - tcp_connection (noblock) - tuntap_pdu block The digital and FEC modules had a large number of references to the PDU blocks that were moved from gr-blocks to gr-pdu, this updates these changes in example flowgraphs and a few python files. The usage-manual update will be propagated to the wiki so that future exports will remain up to date. Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
* gr-blocks: deprecate print_pdu port of message_debug blockJacob Gilbert2021-02-251-6/+6
| | | | | | | | | Having two print ports on this block has confused a number of people, most recently issue #4191, and combining them is straightforward and should make this block easier to use. The print_pdu formatting is now be applied on the print port if the message is a PDU. Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
* clang-tidy: run full .clang-tidy on C++17 codebaseMarcus Müller2021-01-194-4/+4
| | | | | | | | | | | | | | | | | | | | run /usr/share/clang/run-clang-tidy.py -checks=file '-header-filter=.*' -fix .. from build directory. Then, clang-format -i $(git diff --name-only origin/master) to clang-format changed files. Then, refresh all header hashes in pybind bindings (*/python/bindings/*.cc) Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* rotator: add getter rotator::phase()Jeff Long2020-11-251-0/+1
|
* modernization: `override` instead of virtual in all compilation unitsMarcus Müller2020-11-031-2/+2
|
* Fix typos throughout the codeluzpaz2020-10-293-3/+3
| | | | | | | * Fix various typos Found via `codespell v2.0.dev` `codespell -q 3 -L ans,fo,hist,inout,ist,ith,nd,sinc,uint -S ./volk`
* blocks: improvements to the message_debug blockJacob Gilbert2020-10-241-1/+6
| | | | aggregates the data to be printed into a stringstream so that it is printed at the same time reducing debug information becoming muddled between competing cout statements. this change also provides an argument to this block to disable the printing of PDU uniform vectors which are often not needed for debug purposes
* blocks: comment fix, typo in complex_to_real.h, complex_to_imag.hPaul Boven2020-10-122-2/+2
|
* blocks: New block 'Stream Demux'David Pi2020-09-252-0/+71
| | | | | | | | | | | | | | | | Stream demuxing block to demultiplex one stream into N output streams. Demuxes a stream producing N outputs streams that contains n_0 items in the first stream, n_1 items in the second, etc. and repeats. Number of items of each output stream is specified using the 'lengths' parameter like so [n_0, n_1, ..., n_N-1]. Example: lengths = [2, 3, 4] input stream: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...] output_streams: [0, 1, 9, 10, ...] [2, 3, 4, 11, ...] [5, 6, 7, 8, ...]
* gr-blocks: More graceful error handling of missing sndfile dependency.Ron Economos2020-09-201-3/+9
|
* blocks/correctiq: Remove manual memory management & add constThomas Habets2020-09-092-4/+4
|
* gr-blocks: Transition the WAV sink and source blocks to libsndfile.Ron Economos2020-09-012-66/+32
| | | | Compressed input and output with FLAC and Ogg Vorbis now supported.
* blocks: remove log2_constMarcus Müller2020-08-142-91/+0
| | | | | | | | | | | | Was not standards-compliant (assert(0) in constexpr) Only used in packed_to_unpacked to get the log2(number of bits(type)) in packed_to_unpacked<type>. Was not wrapped to python nor public API. To little surprise, a static method compiles faster, and gets compile-time-calculated by a modern compiler, too.
* blocks: remove bin_statistics_f block due to swig dependenceJosh Morman2020-06-042-65/+0
| | | | | | | | The bin_statistics_f block relies on the SWIG director functionality and therefore will need to be rewritten in the transition to pybind11. Additionally it does not appear documented in any way and there are no example flowgraphs, so it is questionable whether anyone is using it at this point
* blocks: reorder template params for OR blockJosh Morman2020-06-041-4/+5
|
* blocks: wavfile_sink: allow appending to filesjapm482020-04-141-1/+9
| | | | | | | | | | | | | Fixes issue #1569. Implement an option in wavfile_sink that allows appending sound samples at the end of an existing file. For this, a target WAV file must meet these requirements: - the file must exist (will not be created if it does not). - the last chunk in the file must be DATA. - file params must match the configured ones (i.e. sample_rate, nchan and bits_per_sample).
* blocks: refactor and reorganize WAV internalsjapm482020-04-141-19/+35
| | | | | | | | This includes the following: - WAV header parameters are now stored in a struct. - do not assume fixed position of data chunk (useful for appending). - use INT{8,18}T_MAX/MIN. - 0|NULL -> nullptr.
* blocks: replace stderr logging by calls to GR's logging faciltiesMarcus Müller2020-04-131-0/+2
|
* Switch from boost pointers to std C++11 pointersThomas Habets2020-04-01152-152/+152
| | | | | | | | | | | | | | | | | | | Most of this code is automated code changes: ``` set -e SUB="s/dummy/dummy/" for i in shared_ptr make_shared dynamic_pointer_cast weak_ptr enable_shared_from_this get_deleter; do SUB="$SUB;s/boost::$i/std::$i/g" done SUB="$SUB;s^#include <boost/shared_ptr.hpp>^#include <memory>^g" SUB="$SUB;s^namespace boost^namespace std^g" find . \( -name "*.cc" -o -name "*.h" -o -name "*.i" -o -name "*.cxx" -o -name "*.py" \) -print0 | xargs -0 sed -i "$SUB" ``` Only one manual change. In `./gr-fec/lib/fec_mtrx_impl.cc`, add `#include <algorithm>`.
* gr-blocks: Add Phase Shift Block with Msg Capabilitiesghostop142020-03-302-0/+47
| | | | | | | | | | | | This new block provides a native ability to phase shift signals for solutions such as DoA and array-based projects. The block supports both variable and message based updates such that other blocks can provide the appropriate calculations for shifting and only send message-based updates when necessary. Based on a block configuration parameter, shift can be specified either in radians or degrees. his block functions like a multiply const, but with the const limited to abs() == 1 to provide a constant phase shift.
* gr-blocks: Add scaling option to Complex to/from ishort and icharghostop142020-02-204-4/+13
| | | | | | | | | | | | | | | 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-181-0/+6
| | | | | | | | | | 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.
* Blocks: Add DC Spike Removal and IQ Swap Native Blocksghostop142020-02-155-0/+201
| | | | | | | | | | | | 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.
* 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-141-3/+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.
* Update license header to SPDX formatdevnulling2020-01-27160-2080/+160
|
* gr-blocks/packed&unpacked: More constexprThomas Habets2020-01-061-12/+12
|
* gr-blocks: VOLKize add_const_ff implementationGrant Cox2020-01-042-0/+2
| | | | | | | | | | | | - 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-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* clang-format: Ordering all the includesMarcus Müller2019-08-0928-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-format: ordering includes in gnuradio-runtime clang-format: ordering includes in gr-filter clang-format: ordering includes in gr-fft clang-format: ordering includes in gr-audio clang-format: ordering includes in gr-analog clang-format: ordering includes in gr-fec clang-format: ordering includes in gr-wavelet clang-format: ordering includes in gr-zeromq clang-format: ordering includes in gr-vocoder clang-format: ordering includes in gr-video-sdl clang-format: ordering includes in gr-trellis clang-format: ordering includes in gr-blocks clang-format: ordering includes in gr-digital clang-format: ordering includes in gr-uhd clang-format: ordering includes in gr-dtv clang-format: ordering includes in gr-channels clang-format: ordering includes in gr-qtgui clang_format.py: re-enable include reordering
* Tree: clang-format without the include sortingMarcus Müller2019-08-09158-4765/+4770
|
* Fix for misc. documentation + trivial typosluz.paz2019-07-172-3/+3
| | | | | | | | | | | | | Found via `codespell -q 3 -L ans,sinc,hist,ist,ith,uint,fo -S ./volk` Fix typos in gnuradio-runtime/ Fix typos in gr-digital/ Fix typos in gr-qtgui/ Fix typos in gr-channels/ Fix typos in grc/ Fix typos gr-filter/ Fix typos in gr-uhd/ Fix typos in gr-blocks/ Fix typos in gr-fec/
* blocks: random_pdu mask parameter fails under python3Josh Morman2019-07-171-1/+1
| | | | | | | | | | | | | | | | The use of chr() in the grc file for the mask creates an invalid input to the random_pdu make function 1) Change the inputs to unsigned char since this is a mask 2) Remove the chr() from the grc yml I'm not entirely sure what the purpose of the chr(mask) in the make function was, but it created invalid input Instead just pass the bitmask directly fixes #2557
* blocks: replace blks2_selector with new implementationJosh Morman2019-06-152-0/+66
| | | | | | | | blks2_selector was deprecated and finally removed This block implements the same functionality but in a way more similar to the Copy block fixes #2460
* blocks: Modify File Source block to work with named pipes and devices.Ron Economos2019-03-311-2/+2
| | | | | The block uses fseek and ftell, which don't apply to named pipes and character/block devices.
* blocks: Fix file_source offset/length to properly access large files.Ron Economos2019-02-141-3/+3
|
* Change vector length variables to unsigned typeSebastian Müller2018-11-015-5/+6
|
* gengen replacement: fix for not installed header filesLukas Kuzmiak2018-10-041-0/+2
|
* Merge remote-tracking branch 'origin/next' into merge_nextMarcus Müller2018-08-3145-997/+481
|\
| * blocks: replace gengen with C++ templatesAndrej Rode2018-08-2539-813/+448
| |
| * Changed file_meta_sink's signature to take unserialized pmtMarcus Müller2018-07-141-8/+11
| | | | | | | | | | | | | | | | | | | | For some reason, the block accepts serialized PMT from in-GNU Radio, then unserializes it, then serializes it back. All possible uses probably will prefer just passing the PMT itself. Changing the API inherently fixes the Py3-migration related std::string handling ambiguity.
| * Unbreak boost 1.67. Constrain the delay in message_strobe to integer ↵Peter Horvath2018-07-081-3/+3
| | | | | | | | milliseconds.