| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
- replace C-style cast with reinterpret_cast<>
- make some variables const
- prefer in-class initializers for static data
- avoid copies in for loop by using a reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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, ...]
|
|
|
|
|
|
|
| |
Calling libsndfile sf_read/write_float() for every sample created
too much overhead. sf_read/write_float() is now called every 1024
samples for the wavfile source block and every 8192 samples for
the wavfile sink block.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Compressed input and output with FLAC and Ogg Vorbis now supported.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First batch of changes:
```
find […] -print0 | xargs -0 sed -i -r '/get_initial_sptr/{:nxt N;/;/!b nxt;s/get_initial_sptr\(\s*new ([^(]+)(.*)\)\)/make_block_sptr<\1>\2)/}'
```
Then:
* Back out `sptr_magic.h` edits
* Change some `friend` clauses
* clang-format the whole thing
* Update checksums in the pybind11 bindings files
|
|
|
|
|
| |
This includes the first edit of a block, so that it's easy to review.
A following commit changes this globally.
|
|\
| |
| |
| |
| |
| | |
Goodbye, and thanks for all the fish, SWIG.
Please refer to docs/PYBIND11.md for details on how to deal with Pybind.
|
| |
| |
| |
| | |
Make sure, code is properly formatted everywhere.`
|
| |
| |
| |
| |
| | |
With this commit, all calls to `set_msg_handler` in `gr-blocks` use
lambdas. This helps to use `std::function` instead of `boost::function`.
|
| |
| |
| |
| |
| |
| |
| | |
This commit is a first stab at moving from `boost::function` to `std::function`.
For now, it does only update gr-blocks. Also, this requires more testing.
If others can confirm that this change works, I'll continue to update all modules.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This improves performance of moving average for me by about 4-5x.
My test is
[here](https://github.com/ThomasHabets/radiostuff/blob/master/amateur/listen_70cm.grc),
which processes 10MHz to find the strongest signal.
Without this PR I see `moving_average` in `top` taking about 89.4-94%
CPU. With this patch it's ~20.4-23.7%. Since without this patch it's
that high, I don't know that it's not even better.
Test measured on a Libremv2 with Intel Core i7-6500U @ 2.5GHz.
The memory access pattern is probably worse with this patch, but at
least on my hardware on my workload this seems to be dwarfed by the
gain of using volk. It can be hard to reason about memory access
patterns, so benchmarks overrule theory.
The test only actually uses float averaging.
More benchmarking may be required.
Possible improvements:
* Add template specialization for `uint16` and `uint32`?
* Refactor for non-volk fallback to use only one loop, with
(presumably) better memory access pattern)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code fixes two issues:
1. The code used `::min()` in one place, and "minus infinity" in
another, for the same purpose.
2. It used minus infinity on integer types, which is undefined
behavior.
(1) seems to have been accidentally left out of
9d9ea63c45b5f314eb344a69340ef49e8edafdfa.
(2)
Section 4.9:
> The behavior is undefined if the truncated value cannot be
> represented in the destination type.
And trunc() on infinity is still infinity, which can't be represented
in integer types.
|
| |
|
| |
|
|
|
|
| |
Add append option to grc file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The example test_16bit_1chunk.wav was invalid even if the tests passed.
This file caused errors in ffprobe (from ffmpeg) and wave (from python
standard lib).
This is what changed:
- LIST chunk corrected, according to spec. Previously `ffprobe` complained:
[wav @ 0x5653f92d6dc0] too short LIST tag
- File size corrected. Previously the test assumed that the resulting
headers to be identical, this is now taken into account.
Because of this, python's `wave` did not work. This is added to the test.
Parser is updated to check file size.
- Tests that did not close opened files were corrected.
References:
[1] https://sites.google.com/site/musicgapi/technical-documents/wav-file-format
[2] http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure that data passed to the file sink is written to the disk when
the flowgraph is stopped. Before this change this only happened
implicitly due to a fclose() in the base class destructor. This in turn
means that data was written delayed after stopping the flowgraph [1].
This fixes #2590.
[1] https://github.com/gnuradio/gnuradio/issues/2590
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the volk/ submodule pointer and updates the CMake to detect
VOLK like any other dependency. The VOLK_MIN_VERSION CMake variable is
added (and set to 2.1.0).
The GR_VOLK_LIB variable is replaced with Volk::volk everywhere.
The VOLK_INSTALL_LIBRARY_DIR and VOLK_INSTALL_INCLUDE_DIR variables
weren't used and were removed.
CMake will now fail if VOLK cannot be detected. Therefore, ENABLE_VOLK
was also removed as a variable; all in-tree components may assume the
existence of VOLK.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>`.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
These updates add the ability to set the block delay value with
an asynchronous message. In this manner, blocks doing calculations
such as those for DoA or antenna arrays can provide delay updates
only when needed.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This fixes a logical bug introduced in
88a9e1f9332d54c1743d062adfaf48aa6d3040ff, where error conditions were
AND'ed together instead of OR'ed.
|