LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_pyindatahandler.cpp File Reference
#include "arma_npy.h"
#include "debugtrace.hpp"
#include "lasp_clip.h"
#include "lasp_daq.h"
#include "lasp_daqdata.h"
#include "lasp_ppm.h"
#include "lasp_rtaps.h"
#include "lasp_rtsignalviewer.h"
#include "lasp_streammgr.h"
#include "lasp_threadedindatahandler.h"
#include <armadillo>
#include <atomic>
#include <chrono>
#include <pybind11/pybind11.h>
Include dependency graph for lasp_pyindatahandler.cpp:

Go to the source code of this file.

Classes

class  PyIndataHandler
 Wraps the ThreadedInDataHandler such that it calls a Python callback with a buffer of sample data. Converts DaqData objects to Numpy arrays and calls Python given as argument to the constructor. More...
 

Functions

template<typename T , bool copy = false>
py::array_t< T > getPyArrayNoCpy (const DaqData &d)
 Generate a Numpy array from daqdata, does NOT create a copy of the data!. Instead, it shares the data from the DaqData container.
 
template<typename T , bool copy = false>
py::array_t< d > dmat_to_ndarray (const DaqData &d)
 
void init_datahandler (py::module &m)
 

Function Documentation

◆ dmat_to_ndarray()

template<typename T , bool copy = false>
py::array_t< d > dmat_to_ndarray ( const DaqData d)

Definition at line 66 of file lasp_pyindatahandler.cpp.

◆ getPyArrayNoCpy()

template<typename T , bool copy = false>
py::array_t< T > getPyArrayNoCpy ( const DaqData d)

Generate a Numpy array from daqdata, does NOT create a copy of the data!. Instead, it shares the data from the DaqData container.

Template Parameters
TThe type of the stored sample
Parameters
dThe daqdata to convert
Returns
Numpy array

Definition at line 33 of file lasp_pyindatahandler.cpp.