09-15-2025 03:01 PM
Hi all,
I am trying to capture vibration from an accelerometer using the Sound & Vibration toolkit. I need the output to be in mm/s RMS and I would like to calculate the RMS once every second. I started with one of NI's examples, and I think I am nearly there. Attached is my code. My questions are:
09-15-2025 03:23 PM
I cannot look at your VI, but to go from acceleration to velocity, you need to integrate. Typically before integrating you use a high pass filter set around 10Hz to eliminate any low frequency drift that would lead to a continuously increasing integral/velocity. The other method is to do the integration in the frequency domain. There the coefficients, except for 0f, which you can set to 0, are divided by 2 pi f.
09-15-2025 04:11 PM - edited 09-15-2025 05:17 PM
Yes, you need to integrate to get displacement from acceleration. (see below)
I don't have your toolkits and cannot look at your VI, but you did not tell us the loop rate. Once you know the loop rate, you know how many samples are needed for one second and you can uses a ptbypt RMS to get the result for one second worth of data.
09-15-2025 04:13 PM
@altenbach wrote:
Yes, you need to integrate (twice) to get displacement from acceleration.
09-15-2025 05:15 PM
@mcduff wrote:
@altenbach wrote:
Yes, you need to integrate (twice) to get displacement from acceleration.
Sorry, meant to say speed. 😄
(hopefully, vibration does not cause overall displacement, except at the end of destructive testing 😄 )
09-16-2025 06:34 AM
Hi everyone. Thank you for your replies. I realize the subject of my post is a bit misleading. I actually know how to convert mm/s^2 to mm/s. Below are my questions, and I was able to answer one of them myself. Can anyone help with the first one in BOLD? I also uploaded a snippet so you can see my code easier:
09-16-2025 06:52 AM
Hi J,
@josborne wrote:
- Q2 I am grabbing 2048 samples from the buffer (chunk size=2048) every iteration because I want to display the data quickly. The VI that is calculating RMS appears to be giving me an RMS value for every chunk, instead of every second. How do I get a value every second?
I was having trouble using the RMS subVI from the Sound & Vibration toolkit, so I just switched to the one shown below. It calculates RMS once per second nicely now.
09-16-2025 08:51 AM
Hi josborne,
I haven't used the Sound & Vibration toolkit but if you're converting a voltage signal to engineering units, the pregain value is usually used to account for any gain applied to the signal before it reaches the data acquisition system. For example, if you were passing the voltage signal through an amplifier before connecting it to the DAQ the pregain would specify whatever gain had been set on the amplifier. If you have no pre-conditioning, set the gain to 0 if it's specified in dB or 1 if it's a linear scaling.
The dB reference is just whatever reference value is used when converting from engineering units to decibels: dB value = 10 * log10(signal^2 / dB reference^2). Changing the reference by a factor of 10 results in the dB value changing by 20 dB, i.e. 10 * log10(10^2), but as long as you're consistent it doesn't matter so much as it can be easily corrected.
PsyenceFact
09-16-2025 09:40 AM
@josborne wrote:
- Q1 What do I specify for dB reference and pregain? Or can I ignore these?
Google is your friend. Check out this https://www.microflown.com/blogs/db-level-references-acoustics
09-16-2025 09:43 AM
@PsyenceFact wrote:
Hi josborne,
I haven't used the Sound & Vibration toolkit but if you're converting a voltage signal to engineering units, the pregain value is usually used to account for any gain applied to the signal before it reaches the data acquisition system. For example, if you were passing the voltage signal through an amplifier before connecting it to the DAQ the pregain would specify whatever gain had been set on the amplifier. If you have no pre-conditioning, set the gain to 0 if it's specified in dB or 1 if it's a linear scaling.
The dB reference is just whatever reference value is used when converting from engineering units to decibels: dB value = 10 * log10(signal^2 / dB reference^2). Changing the reference by a factor of 10 results in the dB value changing by 20 dB, i.e. 10 * log10(10^2), but as long as you're consistent it doesn't matter so much as it can be easily corrected.
PsyenceFact
Exactly right and affirmed by SVT help for those controls: