hi,
I am trying to display the output of the sensor (voltage ) as frequency, I have tried many codes but none could solve the issue can anyone send a code that could solve my issue.I am using teensy 3.2 and Arduino zero.I need a code for either Arduino zero or teensy 3.2.
What kind of sensor? What kind of display?
gfvalvo
November 28, 2017, 11:53am
3
Here's a 16-bit, fix-point FFT that can be adapted for use in the Arduino IDE:
fix_fft.c
/* fix_fft.c - Fixed-point in-place Fast Fourier Transform */
/*
All data are fixed-point short integers, in which -32768
to +32768 represent -1.0 to +1.0 respectively. Integer
arithmetic is used for speed, instead of the more natural
floating-point.
For the forward FFT (time -> freq), fixed scaling is
performed to prevent arithmetic overflow, and to map a 0dB
sine/cosine wave (i.e. amplitude = 32767) to two -6dB freq
This file has been truncated. show original
fix_fft.h
#ifndef FIX_FFT_H
#define FIX_FFT_H
int fix_fftr(short*, int, int);
#endif
main.c
#include <stdio.h>
#include <stdlib.h>
#include "fix_fft.h"
FILE*fp;
#define FFT_SAMP (9)
char help[] = "usage: <in> <out> <inverse? 1 : 0>";
int main(int argc, char** argv)
This file has been truncated. show original
Also, the Teensy Audio library contains several FFT classes. Check out the built-in examples.
gfvalvo
November 28, 2017, 12:16pm
4
aravindaguru:
I have tried many codes but none could solve the issue can anyone send a code that could solve my issue.
Given that you didn't tell us what your "issue" is, it might be rather difficult.