Code Monkey home page Code Monkey logo

Comments (2)

d4vidyo avatar d4vidyo commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.