xtensor-stack/xtensor-fftw

Build demo

egpbos opened this issue · 5 comments

A cling Jupyter notebook showing interactive usage. Something with an image, something with filtering, maybe something with audio. Maybe there are numpy.fft notebooks that we could draw inspiration from as well.

Ideas on using audio:

The best and easiest way to read a WAV file is to use libsndfile.
Although many programs have own wav readers, most of them do not fully support the wav format.
The standard C++ code with 'libsndfile' is like the follows:

#include <sndfile.hh>
SndfileHandle sfr("foo.wav");
std::vector<float> wav(sfr.frames());
sfr.readf(wav.data(), sfr.frames());

We can directly load a wav file to a 'xtensor' by passing the first argument of 'readf' with its raw pointer.

Waiting for a xeus-cling macOS conda package.

Have been experimenting with an edge detection demo. Idea by @maartenbreddels: add a slider with an angle to interactively change the direction of the derivative. Currently, display is not responsive enough for this to work nicely, but we can already build it anyway (like the xtensor-io demo).

Added demo in d1bccf1

Suggestions by @LourensVeen: use using namespace xt to simplify the notebook code and convert as many types as possible to auto, explaining why they cannot be used where they cannot be used.