My team want to evaluate and check micro current through a sensor and bluetooth to react-native app when someone workout.
I have a list of voltage powers from workout.
example) list = [1023,300,200,500,...]
Xaxis is index(This will change to time).
Yaxis is voltage.
My Maximum size is 1023(max is 1024-1)
I want to make this data into frequency and amplitude graph(linear graph that I can know I am doing good on my workout)
My mentor said me to use the fast fourier transform. But it doesn't matter if I use different algorithm or just integral to make the list data to frequency and amplitude linear graph.
There was no react-native library, I have searched some npm library such as fft-js, fft.js, dsp.js
from here https://npm.io/search/keyword%3Afft/1
But I don't know how to use them. I really don't understand where to put my data when I use the library.
for instance, https://npm.io/package/fft.js
const FFT = require('fft.js');
const f = new FFT(4096);
// what is the size meaning? It means my voltage maximum height? which is 1024?
const input = new Array(4096);
input.fill(0);
const out = f.createComplexArray();
//where to put my data to realInput variable??
const realInput = new Array(f.size);
f.realTransform(out, realInput);
If there is an example GitHub code, it would be really helpful.. If someone made it, would you please help me?
I have found out signal data should be power of 2. It worked well.I used fft-js npm library