07-04-2016 02:50 PM
Hello guys,
I'm trying to FFT the internal accelerometer readings of myRIO 1900, to study the spectrum in frequency domain.
I'm kinda new to this so I dunno how to do it but here's what I know ( but I still don't know how to do it ).
* I need to take samples with a certain sampling rate from the myrio Z axis for example.
* Storing these samples in an array.
* FFTing the array of samples.
* Loop to update the values.
I am also trying to achieve a figure that's very near to that if I connected a simulate signal with FFT then a graph to have an output like this.
Anyway, here is the project I am working with.
And here is the meaning less graph I get.
Please help me to achieve what I am failing to.
Thanks in advance.
Solved! Go to Solution.
07-04-2016 07:24 PM
You have two things that are important for the FFT to give you a meaningful result: the samples and the sample rate.
When you pull the data from the accelerometer, you're pulling a single data point. This isn't an array of points. It's a single point. The FFT wouldn't make much sense here. You'll first want to build an array of points and then work with that. When you do have that array, you can't extract frequency data without having the sample rate included. You'll want to build a waveform to pass into the express VI that includes the dt value so you can let it know how fast you're sampling. Alternatively, you can use one of the non-express FFT VIs and give it the sample rate.
07-05-2016 07:51 AM
Thanks for the reply.
Well I now understand that I should have a certain block that takes samples and saves it in an array with a certain sampling rate, Then this block's output should be passed to another block that converts these samples to a waveform passing the waveform to FFT then graph?
If that's right, If you please to tell me how that could be acheived, I'd be more than thankful.
07-06-2016 02:27 PM - edited 07-06-2016 02:28 PM
Michel,
You may want to try something like this:
This code will take 100 samples per while loop cycle at a sampling rate of 1000 Hz (1/loop period, loop period = 1 ms), format the data into a waveform and send that waveform to the spectral measurements VI.
Quick edit: Attached VI
07-06-2016 04:21 PM
Thank you so much @yea_likethecity for your reply.
This was exactly what I was looking for.
Regards.
09-20-2018 07:42 AM
How can it be adjusted for higher sampling rate? myRIO seems to be poor for this. I was hoping that the FPGA core would make it incredible.
09-21-2018 04:02 PM
This seems to be unrelated to the original topic. You might have better luck if you make a new thread.
09-26-2018 04:38 PM
@mbriago wrote:
How can it be adjusted for higher sampling rate? myRIO seems to be poor for this. I was hoping that the FPGA core would make it incredible.
I may have misunderstood your question... are you asking how to get a speedup by running the solution VI on your FPGA?
From the looks of it, the VI above isn't necessarily set up to run on an FPGA so a post more along the lines of "How do I adjust this VI to run on an FPGA" might get you better results.
I see that you have another post asking about FFT Acquisition and Sampling Rates. If this is the code you are trying to run on your FPGA, I'd link this post there!