Comments (2)
Hi,
samplingFrequency is the value which states how often per second the ADC is reading the Voltage.
sampling_period_us is just how much time is between each of those reads in microseconds or 10^-6 seconds.
In the FFT_03 example there is another value right above samplingFrequency called "samples". This value tells your ADC how many readings it should take before the Arduino performs the FFT. Because in order to calculate the FFT you need a complete array of readings.
So if you have a samplingFrequency of 100Hz this would give you a sampling_period_us value of 10 000 microseconds or 0.01 seconds. Which means every 0.01 seconds your ADC is measuring the Voltage once. This happens for samples amount of times so if you set your samples value to 64 you will end up with an array of 64 Voltage readings which would take 0.64 seconds to measure.
So to end up with 2-3seconds of sampling time you just need to adjust the samples value. Be sure it is a power of 2 (2, 4, 8, 16, ...1024 etc.). If you set it to 256 samples this would take 2.56 seconds which would be right in your desired time.
However if you want to see if the motor has some weird frequency's going on that are above 50Hz you would need to increase the samplingFrequency but i think you understood that part about Nyquist.
Hope this helps!
David
from arduinofft.
Related Issues (20)
- Hann window incorrectly defined
- formula for windowing algorithms HOT 9
- An example of implementation HOT 1
- Phase Phase Phase
- Hann window should be corrected
- Inverse Hann not working - or am I missing something?
- Needed Documentation HOT 1
- Needs function to calculate octaves
- Implement C++ template HOT 5
- (improvement) use sqrtf() on ESP32 HOT 2
- Windowing / Weighing Factor HOT 1
- too much time cost for compute FFT on Esp32-C3 HOT 6
- Weird results while imag input other than 0 at example FFT_1 HOT 2
- I thought I was nearly there but can't quite get it over the line. HOT 5
- Updating Documentation and Examples HOT 1
- Performance++ HOT 10
- Needed FFT real time example HOT 1
- average FFT result HOT 1
- calc complex amplitude for only specific frequencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinofft.