Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

10-30-2019 02:55 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi guys,

I am stuck for this part on the signal analysis. I have gotten the z-axis data for the accelerometer and it is shown on the screenshot that I attached. How do I transform the data acquired properly by using Fast Fourier Transform to analyze the signal?

The given VI now I used a FFT pt by pt analysis but is not working properly whenever I inject vibrations for the accelerometer, the amplitude remains constant at 100 the signature does not change. Could advise accordingly for this?

Thank you.

Solved! Go to Solution.

10-30-2019 04:28 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

First: If you want to do meaningfull signal processing on acceleration signals you should use SI units 🙂

G?, g and even g_n or g_local are no SI units ...

If you get yor signals via serial and want to apply a FFT: Samplerate is known and constant?

(MEMS often use internal oscillators and are quite temperature sensitive 😉 )

Sorry, still stick to an older version of LV ... no chance to look into your code

try to collect the samples in an array, apply a FFT and compare it to the pt by pt ...

Greetings from Germany

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

10-30-2019 07:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Henrik,

the units is in acceleration g=9.81 m/s. The signals are via serial modbus rs485 RTUand the sample rate is a fixed frequency.

Could you let me know your version of the LabVIEW, I will reupload it according to yours? Also, I uploaded the datasheet of the accelerometer that I am using.

Thanks.

Cyongjed.

10-30-2019 08:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

To do an FFT (Fast Fourier Transform), you need (a) data sampled at __equally-spaced times__ (the frequency of sampling and the number of data points sampled determine the number of discrete frequencies and the lowest frequency in the spectrum, from which you can deduce the highest frequency), and (b) for the FFT to be "fast", the number of points needs to factor nicely, which is why the optimum N is a power of 2.

One generally acquires, say, 1024 points at a time, then hands those points off to an FFT which returns a representation of the spectrum of the data (you can plot this in various ways). The next 1024 points will (probably) give you a slightly different spectrum, due to noise and possible changes in the underlying signal. Except in certain specific cases (like getting a "voice print"), re-doing the spectrum as each point comes in rarely makes sense.

I recommend re-designing your code, possibly using a Producer/Consumer Design, into an "Acquire N (ideally 2^n) Data Points" (Producer) and "Do an N-point FFT and display results" (Consumer).

Bob Schor

Bob Schor

11-08-2019 11:40 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

11-08-2019 11:52 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Henrik,

sorry for the late reply, I uploaded a new version of the LV2012 for the VI in a new message I posted, the sampling rate is known and constant at 20Hz, so for your suggestion I build a for loop as attached in the screenshot?

11-09-2019 04:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

OK, you attached your VI (thanks), and I think I know a bit more about what you are doing, though I'm not sure I understand what you are __trying__ to do. I also think, based on your questions and comments, that you don't quite understand signals, sampling, and frequency analysis.

Here's what I'm "guessing" from the code you posted --

- You have an instrument that can acquire data from an accelerometer.
- You have a tri-axial accelerometer.
- You get data using a Modbus Protocol.
- You mention a sampling frequency of 20 Hz, yet your VI shows a Frequency chart/graph going up to 500 Hz.

I have no experience with this Protocol. However, I do know about Signals and Sampling. I'm worried that there's too much that either you or I don't understand about what you are doing.

What is the question that you are trying to answer? I know that it involves an accelerometer -- to what is it attached, what is causing the acceleration, what do you think is the "question" you are trying to answer (or the data you are hoping to see)? Are you looking at something that is more-or-less periodic (such as a vibration that you record while a motor is running) or transient in nature (like the vibration pattern after you hit a beam with a hammer)?

In order to record signals and subject them to time and frequency analysis, you need to acquire data (i.e. X, Y, and Z accelerations) at a __known sampling frequency__ (which needs to be __higher__, at least a factor of 2, usually more like 10, than the highest frequency of interest in the signal). You don't say anything (or I didn't read it carefully and don't remember what you wrote, sorry ...) about the instrument taking the data, and how you get it sent to your LabVIEW routine (except that it involves Modbus, a protocol I don't know). But if you have a graph showing a frequency of 500 Hz, then your sampling rate must be __at least__ 1 kHz.

Is your sampling __continuous__ or intermittant? You are sending data via a Protocol, suggesting you are gathering "a bunch" of data (amount not specified), sending it, getting another bunch, sending, etc., but is the time difference between the last sample of the first bunch and the first sample of the second bunch the same as the time difference between pairs of points within the sample? [That would be "continuous" sampling].

Let me give you a more specific example. I'm going to assume you've got a "noisy motor" that is running at a constant speed, but vibrates too much. So let's record at 5 kHz, and acquire 1024 points (why not 1000? The FFT works best with powers-of-2). This will take 1024/5000 = 0.2048 seconds. I compute the spectrum of this signal, which gives me power, or gain/phase, or something, at 512 frequencies from roughly 5 Hz (1/0.2048) to 2.5 kHz (half the sampling frequency). If I am interested in higher frequencies, I sample at a higher sampling rate; if I am interested in lower frequencies, I sample for a __longer time__.

I do __not__ do a point-by-point FFT. I'm not 100% certain I understand where this would be useful (there are better routines for studying time-varying spectra, but that's a more complex topic).

Bob Schor

11-10-2019 06:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Bob,

Thanks for the reply, really appreciate it. From the strings in hexadecimal from the Modbus Registers which in this case the sampling is continuously acquired, I converted them to numbers and minus the offset (in the SubVI) that I called to get the X, Y, Z out respectively in terms of G (9.81). I am quite new to this signal processing couldn't fully grasp the concept of it but I am tasked to do it for my capstone project. Your 4 assumptions are correct

Questions I have:

1) Output Rate of the Accelerometer Digital Signals = Sampling Frequency am I right to say that? I am confused by this too.

2) If I don't do point by point, how can I go about doing the Normal FFT?

Solution

Accepted by topic author cyongjed

11-10-2019 11:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Remember -- I am unfamiliar with the Modbus Protocol, so I have no idea how the accelerometer data are being sampled and how you are acquiring the data. I find it amazing that as part of a capstone project, you can't provide definite answers (or provide sufficient details, such as manual pages, setup parameters, etc. for me to figure it out myself) to questions such as what sampling rate you are using. So here are some questions that you should answer:

- What are you measuring? I know you are using a tri-axial accelerometer, but I don't know if you are measuring
__orientation__(tape it to a helmet, have subject wear helmet while walking around),__vibration__(and of what, for example, electric motor rotating at 400 rpm), or impulse activity (impact hammer). - What
__question(s)__are you asking about your device? How does the concept of "time" and "repetition" enter into your question? For example, are you interested in how a building sways during the course of a day, or comparing how the vibration of a motor depends on the RPM at which it spins? Don't be afraid to attach the "Introduction" material for your Capstone report. - If you still don't know how to answer the question of what Sampling Rate you are using, someone is either doing a very poor job in
__teaching__Engineering or a very poor job in__learning__it. Make a concerted effort to determine this critical parameter -- talk to your fellow students, or talk to your instructors.

Bob Schor

11-11-2019 11:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Bob,

I found the solution to my problem. Really appreciate the advice that you given me.