LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

First three harmonic analysis

Hi
I am using LabView 7.1 on windows xp. I am acquiring the data through pressure transducers using DAQ Assistant. I need to plot the first three harmonics of the signal simultaneously in a single plot. I tried using distortion measurements express vi but couldn't able to do that. Can anyone please tell how to do it?

Thanks in advance

Pramod
0 Kudos
Message 1 of 48
(5,360 Views)
Hi Pramod,
 
I'm not sure how you have stored or acquired the data, but to plot 3 different waveform on a single graph you can use the merge signals function from the express pallet. You can also build an array with the different waveforms and pass the array to the graph.
 
If this doesn't answer your questions please explain how you are aquiring the data, calculating the harmonics and storing the waveforms to be graphed. You can also attach your VI if you can eliminate all the unnecessary components in it.
Sappster
0 Kudos
Message 2 of 48
(5,323 Views)
Hi Mark

Thanks for your reply. I am acquiring the data with the help of circumferentially placed 6 pressure sensors using DAQ Assistant as shown in the attached vi. I need to plot the first three harmonics (fourier modes) of the signal which I couldn't able to do. I have not included the distortion measurement express vi in this code to calculate the first three harmonics.

Pramod
0 Kudos
Message 3 of 48
(5,315 Views)
Hi Pramod,
 
Is the output of the Distortion Measurment Express VI the signals that you want to plot on the same graph? Do you want to plot the Total Harmonic Distortion or Specific Harmonic Distortions? How do you want to plot this information? Because the ouput from the Distortion Measurement Express VI is a single value for the distortion. Are you wanting to see a frequency domain plot of the signals? Or do you just want to see the three harmonics compared to each other.


Message Edited by Mark_S. on 05-29-2008 01:19 PM
Sappster
0 Kudos
Message 4 of 48
(5,301 Views)
Hi Mark

I want the first three harmonics in a single plot. I have attached an image file just to show exactly what I want. The digits from 1 to 5 in the image are first five harmonics. I need first 3 harmonics only. The x-axis in the image is the time. I think this will clear exactly what I want. If you need any further information, please let me know.

Thanks

Pramod
0 Kudos
Message 5 of 48
(5,280 Views)

Hi Pramod,

I recommend taking the output of the Distortion Measurment VI and building an array with it. You will also need to use a shift register to retain the values in the array. Attached is an example. Let me know if you have any questions.

Sappster
0 Kudos
Message 6 of 48
(5,261 Views)
Hi Mark

Sorry for late reply. I was out of station for some work.
The vi code you sent is from LabView 8.5. However, I am using LabView 7.1.  But anyhow I managed to get the code from other LabView loaded pc. I have attached the vi code using DAQ Assistant. The x-axis of the code should be time in seconds. So I think there should be waveform chart instead of waveform ghaph. However, when I use waveform chart, the data overlaps between 0-1 seconds and it doesn't exceed the value 1. This is shown in the attached image file.
I need the waveform for the first 2-3 seconds.
Also, can you please tell the use of shift register?

Thanks

Pramod
Download All
0 Kudos
Message 7 of 48
(5,217 Views)

Hi Pramod,

Here is a slightly modified method. It retains the time base for the readings by keeping the data in the waveform data type. If you want to use the reading for any math you will need to extract the array of values from the waveform.

The shift registers are the boxes located on the while loop that contain up and down arrows. They are used to retain the value you put in them, for use in the next loop iteration.

Use shift registers on For Loops, While Loops, or Timed Loops to transfer values from one loop iteration to the next.

Complete the following steps to create a shift register.

  1. Place a structure on the block diagram. For example, place a While Loop on the block diagram.
  2. Right-click the left or right border of the loop and select Add Shift Register from the shortcut menu.

You can use multiple shift registers to remember iteration values and you can use an initialized shift register to reset the initial value of a shift register.

Let me know if I can help with anything else.



Message Edited by Sappster on 06-05-2008 03:23 PM
Sappster
0 Kudos
Message 8 of 48
(5,201 Views)
Hi Mark

Thank you very much for your valuable information. I modified the code as per your code. However, the time in seconds running 10 times faster than actual time. This is shown in the attched the image file. The actual time is from 14.6 to 16.6 seconds. Another query is, can we smoothen the graph so that it will have the shape of small curve? I tried using curve fit express vi but didn't helped much.
Also, if I have to take these results on frequency basis, then shall I have to use Spectral measurement vi?
I have attached the code for first three harmonic measurement.

Thanks

Pramod
Download All
0 Kudos
Message 9 of 48
(5,173 Views)
Greetings Pramod,
 
The reason that you are getting incorrect timing on the graph is because you need to initialize the shift registers with the correct time base information. You can do this by creating a constant with that information in it, or by running the calculations once prior to running the while loop. I have attached examples of both.
 
For smoothing the data you are graphing, you might want to average or filter the data. There are many methods for doing this and you can find examples in the Example Finder Contents under fundamentals » Signal Processing and Analysis. You might find the point-by-point averaging function very helpful, since you are calulation the harmonics point-by-point. You will need to keep in mind that you will have to unbundle the waveform into it's respective components then calculate the average from the Y values. Here is how:
 
 

t0

A Time Stamp representing the time at which the signal measurement starts

dt

A double numeric that describes the difference in time in milliseconds between each sample in the signal

Y

A 1D array of doubles that contains the values of the samples of that signal.

As for measuring frequency, there are many functions for that as well. If you search the help for frequency you can find many examples of measuring frequency.

Regards,

Sappster
Download All
0 Kudos
Message 10 of 48
(5,122 Views)