Giter Site home page Giter Site logo

gr-pipe's Introduction

gr-pipe GNU Radio blocks

gr-pipe is a set GNU Radio block for using any program as a source, sink or filter by using standard I/O pipes.

Introduction

The main goals of these blocks are:

  • Fast development of new experimental blocks (no need to dig into C++ / GNU Radio internals / SWIG / Python).
  • Ability to use any programming language able to deal with standard input and output (code a block in your preferred language: C, Java, MatLab, Perl, Ruby...).

Simple interface:

The gr-pipe blocks read and write samples sequentially in their GNU Radio internal representation. The format is the same as for gr_file_source and gr_file_sink:

GNU Radio type name C Type size
Complex two C floats (I,Q) sizeof(float)*2, generally 8 bytes
Float float sizeof(float), generaly 4 bytes
Int int sizeof(int), generally 4 bytes
Short short sizeof(short), generally 2 bytes
Byte unsigned char sizeof(unsigned char), 1 byte

Since the actual size of some objects may depend on the host platform, it is recommended to use the available language definitions to get correct sizes. Most languages are also providing routines to read/write native machine C types. See examples provided in this package for some languages.

A typical source block command will produce data "forever" on its standard output, until a SIGTERM is sent by the pipe.source block to ask for normal termination. Also, in case of an exception, the pipe will be closed and a SIGPIPE will be caught.

A typical sink block command will consume data on its standard input, until end-of-file (EOF) is read, for a proper termination.

A typical filter block command will comsume data "forever" on its standard input, process it, and produce data on its standard output, until end-of-file (EOF) is read, for normal termination. Also in case of exception, SIGPIPE may be caught.

In pipe blocks, commands are executed in a /bin/sh shell, so every standard shell features are available in commands provided to blocks (variables, loops, pipes, redirection, etc...).

See examples for a "square" block implemented in C, Java, MatLab/GNU Octave, Perl and Python.

Suggestions of use:

  • Compression (gzip, lzma, ...)
  • Encryption (gpg, openssl, ...)
  • Encoding (ffmpeg, mencoder, gsm-tools, ...)
  • Debugging (od, hexdump, ...)
  • Interface to devices (aplay, arecord, pacat, parec, ...)
  • Use your own tools...

Known limitations and problems:

  • Small performance loss, due to pipe communications.
  • Small addition of latency, due to pipe buffers. (On Linux, pipe buffer capacity can be changed. See fcntl(2) F_SETPIPE_SZ).
  • Not compatible with stream tags
  • Limited to only one input and one output maximum per block (but you may use an interleaver or multiple blocks).

Building and installing gr-pipe

Installing manually

This procedure assumes you have development tools and GNU Radio already already installed.

git clone https://github.com/3dfxuser/gr-pipe.git
mkdir gr-pipe/build
cd gr-pipe/build
cmake ..
make
sudo make install
sudo ldconfig

gr-pipe's People

Contributors

jolivain avatar bkerler avatar 3dfxuser avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.