From 39ea0d49f49ac6dbdfda8a5a7b40ac8ff3f738e2 Mon Sep 17 00:00:00 2001 From: mick grierson Date: Tue, 8 Dec 2015 14:56:16 +0000 Subject: adding fft terminal example --- maximilian_examples/20.FFT_example.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 maximilian_examples/20.FFT_example.cpp (limited to 'maximilian_examples/20.FFT_example.cpp') diff --git a/maximilian_examples/20.FFT_example.cpp b/maximilian_examples/20.FFT_example.cpp new file mode 100644 index 0000000..086dac0 --- /dev/null +++ b/maximilian_examples/20.FFT_example.cpp @@ -0,0 +1,31 @@ + +#include "maximilian.h" +#include "libs/maxim.h" + +maxiOsc mySine, myPhasor; // This is the oscillator we will use to generate the test tone +maxiFFT myFFT; + + + +void setup() { + + myFFT.setup(1024, 512, 2); + +} + +void play(double *output) { + + + float myOut=mySine.sinewave(myPhasor.phasor(0.2,100,5000)); + //output[0] is the left output. output[1] is the right output + + if (myFFT.process(myOut)) { + + //if you want you can mess with FFT frame values in here + + } + + output[0]=myOut;//simple as that! + output[1]=output[0]; + +} \ No newline at end of file -- cgit v1.3