Discussion:
First three harmonic analysis
(too old to reply)
pbsalunkhe
2008-05-28 13:40:07 UTC
Permalink
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 advancePramod
Mark_S.
2008-05-29 16:10:06 UTC
Permalink
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.
pbsalunkhe
2008-05-29 17:40:07 UTC
Permalink
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


data_acquisition_code.vi:
http://forums.ni.com/attachments/ni/170/327456/1/data_acquisition_code.vi
Mark_S.
2008-05-29 18:40:09 UTC
Permalink
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
pbsalunkhe
2008-05-30 11:40:06 UTC
Permalink
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.ThanksPramod


harmonics.jpg:
Loading Image...
Mark_S.
2008-05-30 17:40:06 UTC
Permalink
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.


pramod.vi:
http://forums.ni.com/attachments/ni/170/327799/1/pramod.vi
pbsalunkhe
2008-06-05 13:40:09 UTC
Permalink
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


sp_harmonic.vi:
http://forums.ni.com/attachments/ni/170/329117/1/sp_harmonic.vi


specific-harmonic.JPG:
Loading Image...
Sappster
2008-06-05 20:40:06 UTC
Permalink
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 <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/glang/for_loop/" target="_blank">For Loops</a>, <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/glang/while_loop/" target="_blank">While Loops</a>, or <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/glang/timed_loop/" target="_blank">Timed Loops</a> to transfer values from one loop iteration to the next.

Complete the following steps to create a shift register.

- Place a <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/loops_and_structures/" target="_blank">structure</a> on the block diagram. For example, place a <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/glang/while_loop/" target="_blank">While Loop</a> on the block diagram.

- 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 <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/using_shift_registers_to_r/" target="_blank">remember iteration values</a> and you can use an initialized shift register to <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/initializing_shift_registe/" target="_blank">reset the initial value</a> 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


pramod.vi:
http://forums.ni.com/attachments/ni/170/329313/1/pramod.vi
vinu
2008-06-06 18:40:09 UTC
Permalink
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


specific_harmonic.vi:
http://forums.ni.com/attachments/ni/170/329623/1/specific_harmonic.vi


sp-harmonic.JPG:
Loading Image...
Sappster
2008-06-09 16:40:07 UTC
Permalink
Greetings&nbsp;Pramod,
&nbsp;
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.
&nbsp;
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&nbsp;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:
&nbsp;

&nbsp;<img alt="" src="Loading Image...">






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,


pramod.vi:
http://forums.ni.com/attachments/ni/170/329993/1/pramod.vi


pramod1.vi:
http://forums.ni.com/attachments/ni/170/329993/2/pramod1.vi
vinu
2008-06-11 13:40:04 UTC
Permalink
Hi Mark Thank you very much for your mail.When I used pramod.vi, it gave me the error as given below:"Error 50103 occurred at DAQmx Start Task.viThe specified resourse is reserved. The operation couldnot be completed as specified."I think the error is related to the DAQ Assistant express vi.Our data acquition card is loaded a windows pc. LabView 7.1 is installed on that pc. As you sent the code of higher version, I saw these vi on another pc and preapred the same code on a machine loaded with LabView 7.1. I couldnot able to locate the unbandle waveform as you have given in pramod1.vi. Can I use "build waveform" function for the same purpose?Can you please send that vi in LabView 7.1 version?Thanks Pramod
pbsalunkhe
2008-06-11 14:40:06 UTC
Permalink
Hi Mark I tried with the "Build Waveform" and it worked fine. Can you please check the attached code. I have also added the 5th order Butterworth lowpass filter.Still I have one doubt. I will highly appreciate if you can clear that. When I use the DAQ Assistant for normal pressure signal acquisition, I took the data for about 20 seconds. In that case, the waveform comes as straight lines as the number of data points becomes very large. In order to see the sinusoidal wave, I have to magnify it in the range of 0 to 0.1 seconds(extreme ends of x-axis). When we are measuring first three harmonics, we are actually separating out those from the entire waveform. So I think magnification is not required in this case. Am I correct?Thanks Pramod


specific_harmonic.vi:
http://forums.ni.com/attachments/ni/170/330723/1/specific_harmonic.vi
Sappster
2008-06-12 14:10:05 UTC
Permalink
Hi Pramod,
&nbsp;
Do both of the previous responses belong to you? I notice a different screen name and want to make sure I answer all the questions here.
&nbsp;
The reason you were receiving that error is because I placed a second DAQ assistant in the diagram by accident. Sorry for the confusion.
&nbsp;
The method you implemented to initialize the waveform shift register is correct. And the magnification you mentioned won't effect your analysis. However, the filter you added filters the original signal so if you are attempting to smooth the spectral analysis output, you need to move the filter to the other side of the Distortion Masurement VIs.
&nbsp;
Let me know what signal you are wanting to filter.
&nbsp;
Everything else looks good.
pbsalunkhe
2008-06-13 18:40:05 UTC
Permalink
Hi Mark Yes. I sent last both responses. As I told earlier, my pc dont have LabView 8.5 version. So to see the code I have to use other machine. On that machine, other users NI id was already there by default. Therefore, when I replied, it was from that user id. You have answered every question and I am very much thankful to you.Actually, I am using the filter to reduce the noise in the signal coming from the DAQ Assistant. In normal pressure acquisition, I placed the filter immediatly after the DAQ Assistant. As per your suggestion, I placed the filter after distortion measurement express function as shown in the attachment.If noise reduction is the major goal rather than smoothening of function, then can you please tell what should be the correct location of filter?


specific_harmonic.vi:
http://forums.ni.com/attachments/ni/170/331646/1/specific_harmonic.vi
Sappster
2008-06-13 19:10:05 UTC
Permalink
Hi Pramod,
&nbsp;
If you are trying to reduce the noise in the original reading then place the filter right after the DAQ assistant. However, this may filter your harmonics that you are trying to read, so becareful how you filter the signal. If you want to smooth (average) the measurments for the harmonics then you will want the filter (running average) code right after the Distortion Measurement VI.
&nbsp;
If you just want a basic smoothing, I recommend the average pt-by-pt VI found in the Pt-By-Pt folder under signal processing. You will need to manipulate the waveforms you are currntly using. Let me kow if you need any help or have any questions.
pbsdeshmukh
2008-06-15 11:10:05 UTC
Permalink
Hi Mark Thanks for your reply.I am reducing the noise while acquiring the pressure signals. So I will place the filter right after the DAQ Assistant. For getting the first three harmonics, I will place the filter after distortion measurement vi only if it is required or I will use pt-by-pt averaging vi.THanksPramod
pbsalunkhe
2008-06-20 18:40:09 UTC
Permalink
Hi Mark The LabView code for first three harmonic analysis is now working well.I am now doing the power spectral density measurements. I have seen there are two FFT Power Spectral Density measurement options in LabView 7.1. One is Functions&gt;&gt;Analysis&gt;&gt;Spectral&gt;&gt;Power Spectral Density and other is All Functions&gt;&gt;Analyze&gt;&gt;Waveform Measurements&gt;&gt;FFT Power Spectral density. Both are same or different? I have 6 channels for pressure acquisition. Can I take averaged power spectral density of all 6 channels as only a single graph?Thank youPramod
Sappster
2008-06-23 16:10:06 UTC
Permalink
Hi Pramod,
&nbsp;
The 2 VIs you mentioned are not the exact same function, but both calculate the PSD the same.
&nbsp;
You can use the merge signals VI to combine the signals into one graph. Here is an example:
&nbsp;
<a href="http://digital.ni.com/public.nsf/allkb/01AB60FA9A4EDA1B86256D1A004ACB63?OpenDocument" target="_blank">http://digital.ni.com/public.nsf/allkb/01AB60FA9A4EDA1B86256D1A004ACB63?OpenDocument</a>
pbsalunkhe
2008-06-24 10:40:04 UTC
Permalink
Hi MarkThank you for your mail. I have used the split and merge signal previously. I am attaching herewith the two LabView codes to calculate the power spectral density. Correspondingly, I have attached the image files of front panel. The measurement was carried out with 6 channels. The vi-2 image file shows 6 different signals on the same plot while vi-1 gives averaged single plot of 6 channels. The latter is what I am looking for. I am not sure about the code. Is it correct? Also there is a high peak line near zero frequency in vi-2 image file.Pramod


power-spectral-density.zip:
http://forums.ni.com/attachments/ni/170/334364/1/power-spectral-density.zip
Sappster
2008-06-25 19:10:04 UTC
Permalink
Hi pramod,
I have attached an example of how to average the 6 readings. The way you are graphing the PSD in both examples is fine, you just might find it easier to work with the data from the vi2 example.


pramod.vi:
http://forums.ni.com/attachments/ni/170/334928/1/pramod.vi
pbsalunkhe
2008-06-26 16:10:08 UTC
Permalink
Hi Mark The code is working fine. However there is one more doubt.I have placed 6 pressure sensors circumferentially around a circular duct. There is a fan rotating at 1800rpm (30 Hz) inside the duct. The fan has 11 blades. So the blade passing frequency will be 11*30=330 Hz. When I use the option "1D array of scalers-automatic" in the "convert from dynamic data" then it gives high peak at 33 Hz i. e frequency reduces by one tenth of actual. When I use other options in "convert from dynamic data", it gives correct plot showing high peak at 330Hz (i e blade passing frequency). I want to see the high peak at rotor frequency i.e at 30 Hz and not at the blade passing frequency. I used the lowpass filters but didn't helped much. Can you please suggest the way to do it?ThanksPramod
Sappster
2008-06-27 16:40:05 UTC
Permalink
Hi Pramod,
&nbsp;
If you don't have a sensor on the rotation of the entire fan then you will just have to divide the frequency readings by the number of blades to get that measurement. You could seperate the waveform components to get the frequency component and divide it by the number of blades. I explained on the first page how to seperate the waveform components.
pbsalunkhe
2008-06-28 14:40:04 UTC
Permalink
Hi Mark The other way to divide the frequency reading is multiply the x-axis by 1/11. This can be done byx-axis&gt;&gt;formatting&gt;&gt;scales&gt;&gt;multiplier&gt;&gt;0.909090.Is it correct?ThanksPramod
Sappster
2008-06-30 13:40:05 UTC
Permalink
Hi Pramod,
&nbsp;
You can do that to change the scale of the graph, but you are only correcting the graph so if the data changes to a different frequency range, the graph won't reflect the change.
pbsalunkhe
2008-07-01 14:40:08 UTC
Permalink
Hi Mark I tried to change the frequency scale as you suggested. But it is changing the y-axis value instead of x-axis. Other thing is when I use "1D array of scalers-automatic" option in "Convert from dynamic data", the frequncy scale reduces from 330 Hz to 33 Hz as I said in previous post.&nbsp; When I use options other than "1D array of scalers-automatic", the code is showing broken wires. But last time it was running well with these options.The fan frequency is 30 Hz and currently the code is showing 33 Hz(reduced freq. from 330Hz). Can you please tell how to change the frequency scale? ThanksPramod
Sappster
2008-07-07 23:40:05 UTC
Permalink
Hi Pramod,
You might be better off leaving the data in the waveform type, so that the timebase information isn't lost. Some of the prior examples we handled the waveform types, you might want to use techniques similar to methods we tried earlier. I would recommend using the convert from dynamic datatype with the wveform type selected and then correct the rest of the code to use those datatypes.
Let me know if you can't figure out how to handle the waveform types. Maybe we can break down your ultimate goal and then re-work your code to fit your needs.
pbsalunkhe
2008-07-10 12:10:07 UTC
Permalink
Hi Mark I tried with the techniques that we used earlier, but it is taking only "1d array of scalers-automatic". However the maximum frequency it showing is 500 Hz instead of 5000 Hz. I am using 10 kHz sampling frequency. As I said earlier, the blade passing frequency 330 Hz has been shifted to 33 Hz. If we divide blade passing frequency by no. of blades we get rotor frequency which is 30 Hz. I need the plot should show the peak at 30 Hz but currently it is showing at 33 Hz.Is there any other way to scale the x-axis or to average the data of 6 channels?Thanks Pramod
Sappster
2008-07-11 16:40:08 UTC
Permalink
Hi Pramod,
Here is an example that should fix your issue with the x-scale. If you have more questions let me know.
Also, you might find the LabVIEW training classes beneficial. They will teach you methods for manipulating data in LabVIEW and commonly used programming practices. If you have any questions about the training you can look here:
<a href="http://www.ni.com/training/labview.htm" target="_blank">http://www.ni.com/training/labview.htm</a>


pramod.vi:
http://forums.ni.com/attachments/ni/170/340096/1/pramod.vi
Sappster
2008-07-11 16:40:12 UTC
Permalink
Hi Pramod,
&nbsp;
I couldn't convert the VI to 7.1 so here is a screenshot:
<img style="WIDTH: 528px; HEIGHT: 248px" height="247 src= Loading Image..." width="587"> Message Edited by Sappster on 07-11-2008 11:39 AM


example1.JPG:
http://forums.ni.com/attachments/ni/170/340109/1/example1.JPG
pbsalunkhe
2008-07-15 18:40:08 UTC
Permalink
Hi Mark

Thank you for your reply. Now I am getting the 330Hz frequency using this code.
I have attached the LabView code. But I am not able to divide the x-scale value
by number of blades i.e 11.&nbsp; I can do this by multiplying the x-scale
value. Is there any other way to do this?
There is another doubt with the specific harmonic that we have discussed earlier. I have attached the code for specific harmonic. In the left most "Build waveform" function, the "dt" value was placed as the inverse of sampling frequency. In the DAQ Assistant there are 6 channels. Will I have to repeatedly write this code for 6 times to get the averaged first three specific harmonic?The specific harmonics were seen to be of zigzag type even during no flow condition. Also, the x-axis time scale is not coming as per the real time scale. I am attaching the data for sp. harmonic. Do I need to modify the code?Thank youPramod


attachments.zip:
http://forums.ni.com/attachments/ni/170/341152/1/attachments.zip
pbsalunkhe
2008-07-15 18:40:08 UTC
Permalink
Hi Mark

Thank you for your reply. Now I am getting the 330Hz frequency using this code.
I have attached the LabView code. But I am not able to divide the x-scale value
by number of blades i.e 11.&nbsp; I can do this by multiplying the x-scale
value. Is there any other way to do this?
There is another doubt with the specific harmonic that we have discussed earlier. I have attached the code for specific harmonic. In the left most "Build waveform" function, the "dt" value was placed as the inverse of sampling frequency. In the DAQ Assistant there are 6 channels. Will I have to repeatedly write this code for 6 times to get the averaged first three specific harmonic?The specific harmonics were seen to be of zigzag type even during no flow condition. Also, the x-axis time scale is not coming as per the real time scale. I am attaching the data for sp. harmonic. Do I need to modify the code?Thank youPramod


attachments1.zip:
http://forums.ni.com/attachments/ni/170/341154/1/attachments1.zip
Sappster
2008-07-16 22:10:07 UTC
Permalink
Hi Pramod,
To change the timebase for your signal, you can get the waveform component dt, and divide it by the number of blades you are counting. Here is an example of what I'm talking about:
<img src="Loading Image...">
Let me know if this work as expected.
&nbsp;
I'm not sure what you mean by "I have attached the code for specific harmonic. In the left most "Build waveform" function, the "dt" value was placed as the inverse of sampling frequency. In the DAQ Assistant there are 6 channels. Will I have to repeatedly write this code for 6 times to get the averaged first three specific harmonic?"
If you want to change the number of harmonics calculated in the average, you can just wire the outputs of those spectral measurments to a different divisor and graph.Message Edited by Sappster on 07-16-2008 05:00 PM


example1.JPG:
http://forums.ni.com/attachments/ni/170/341607/1/example1.JPG
pbsalunkhe
2008-07-17 19:10:06 UTC
Permalink
Hi MarkI modified the code and it worked well. About specific harmonic:As per your suggestions, I had developed the specific harmonic LabView code (available in previous pages of this post). I am acquiring the data with 6 analog channels with 10 kHz sampling frequency and 1000 number of channels. I am having two queries with this code.1. Will this code work for 6 channels or shall I have to repeatedly write it for 6 times?2. The x-axis, time, is lagging the real time.Please see the attached code and the data file.Thank youPramod


specific-harmonic.zip:
http://forums.ni.com/attachments/ni/170/341932/1/specific-harmonic.zip
Sappster
2008-07-18 16:10:08 UTC
Permalink
Hi Pramod,
&nbsp;
The VI you provided can handle multiple channels being read by your DAQ card.
&nbsp;
As for the time lag you mentioned, can you explain more. I'm not sure I understand. Is the time that you are seeing in the measurment file not the same as the time on the graph?
pbsalunkhe
2008-07-22 11:40:08 UTC
Permalink
Hi Mark The time that I am seeing in the measurement file and the graph is same. But that time is not same as the real acquisition time. I have attached the image file. Figure shows that the measurement time is 0.02 seconds however measurement was carried out for more than 5 seconds.The "dt" parameter in the" build waveform" function (outside the while loop) was selected as 0.0001 based on 10 kHz sampling frequency. Is it correct?Thank youPramod


modified-sp-harmonic.vi2.vi:
http://forums.ni.com/attachments/ni/170/342874/1/modified-sp-harmonic.vi2.vi


sp-harmonic.JPG:
Loading Image...
Sappster
2008-07-23 16:40:08 UTC
Permalink
Hi Pramod,
&nbsp;
I'm a little confused by your example. What is the ultimate goal you want to accomplish?
&nbsp;
I noticed a few things in the code that maybe be altering your calculations unexpectantly. You are adding the values of the harmonics. Is the data you want to graph to total harmonics for the first three harmonics. If so you can just use the Distortion Measurment VI to search the 3 harmonics. Also the values you are calculating from the Distortion Measurment VI is adding the first 10 harmonics together.
&nbsp;
You Might want to use the merge signal function to just graph the different harmonics over time. Attached is an example of what I mean.
&nbsp;
Secondly, with the graph time you will have to provide a timbase for your harmonic calculations because the output is only one value and therefore&nbsp;does not have it's own timing values. I have also included a method for doing this in the example. You will have to calculate the timebase for the harmonis signal you are building by dividing your acquired signal's sampling frequency by the number of samples you are reading.
&nbsp;
Also you might want to note that because you are running this with a simulated signal, the time that is being graphed may not correlate to the actual time on your computer because you are not reading the data at the actual sampling frequency.


sp_harmonic[1].vi:
http://forums.ni.com/attachments/ni/170/343399/1/sp_harmonic[1].vi
pbsalunkhe
2008-07-25 13:10:07 UTC
Permalink
Hi Mark My ultimate goal is to plot first three harmonics with correct time base. I have used the time interval of 0.0001 seconds for 10 kHz sampling frequency. As you have suggested, the time base in my case will be 10 (sampling frequency/no. of samples). Then shall I have to put 'dt=10' in the "Build Waveform" function placed outside the while loop as shown in my previous attachment?I am using only DAQ Assistant and not Simulate Signal for the data acquisition. That day I just tried with Simulate Signal as the pc on which I was working was not loaded with NI card. And by mistake I sent that vi attachment. I couldn't able to open the vi code that you sent as an attachment. The vi code is from higher version and I am using LabView 7.1. Earlier I was having evaluation cd of LabView 9.1 so I managed to open it. However, the evaluation period has expired last week. Therefore can you please send vi code LabView 7.1 version?
Sappster
2008-07-28 23:10:06 UTC
Permalink
Hi Pramod,
&nbsp;
Here is an image of the VI I posted:
&nbsp;
if you are sampling at 10 KHz and reading x samples, then your sampling rate for the distortion should be 10,000/x. In your example you were reading 100 samples. So the distortion samping rate is 100 Hz and the sample time (dt)&nbsp;is .01.Message Edited by Sappster on 07-28-2008 05:55 PM


example1.JPG:
Loading Image...
pbsalunkhe
2008-07-30 18:40:10 UTC
Permalink
Hi Mark Thanks for you reply.I changed the "dt" parameter in "Build waveform" function to 0.1 instead of 0.0001 for 10 kHz sampling frequency and 1000 number of samples. Now it is showing correct time with the earlier vi. So I didn't need to change the vi as you suggested in last post.However, when I am using DAQ Assistant for pressure data acquisition, I am putting dt=0.0001 corresponding to 10 kHz sampling frequency and it is showing the correct real time.This difference, is it because in former case, I am using the "Build waveform" function outside the while loop and "dt" corresponds to measurement interval between two samples rather than interval between two points?Thanks youPramod
Sappster
2008-07-22 15:40:05 UTC
Permalink
Hi Pramod,
&nbsp;
The method used in that example can cause you to have an&nbsp;invalid timebase because you are appending data to a waveform initialized by the waveform constant outside the loop. If the number in the constant doesn't match your acquisition settings it will overwrite them. If you had .0001 for a 10 KHz acquisition you should be reading the correct time, but when I opened the VI it was set to .1.
&nbsp;
What about the other methods we looked at for adding the data together after the acquisition? like the method used in the 6&nbsp;harmonics example? Can you use this method to correct this VI?
pbsalunkhe
2008-07-23 12:10:05 UTC
Permalink
Hi Mark Using trial and error I was just checking the results by varying the "dt" parameter from 0.1 to 0.0001. Today again I checked with 0.0001 sampling time for a 10 kHz sampling frequency, it was showing the data for 0.02 seconds, however it was actually 15 seconds.I also tried with the method that we used earlier for adding the data after acquisition. I have attached the vi. It is showing only single waveform as we have added the three harmonics.Thank youPramod


sp_harmonic.vi:
http://forums.ni.com/attachments/ni/170/343241/1/sp_harmonic.vi
Sappster
2008-07-30 23:10:07 UTC
Permalink
Yes you are correct, it is because the dt in this case is between sampled buffer reads and not the actual points themselves.
pbsalunkhe
2008-07-31 09:10:07 UTC
Permalink
Hi Mark Earlier I carried out few experiments with dt=0.0001 instead of dt=0.1. Can I use the same data by multiplying the x-scale by 1000?Thanks Pramod
Sappster
2008-08-01 17:40:19 UTC
Permalink
Hi Pramod, You are basically multiplying the x scale by 1000 by changing the dt like that. I'm not sure if I understand your question.Does the data appear different after you change that?
pbsalunkhe
2008-08-05 19:10:22 UTC
Permalink
Hi Mark Sorry for late reply. You are correct. I am basically multiplying the the x-scale by 1000 to change the dt parameter. It is not affecting the waveform shape. While acquiring the specific harmonics, the y-axis is amplitude (by default). I guess its unit is PSI (which I converted from Volt to PSI after DAQ Assistant).I searched in LabView help to get the details on how the LabView acquires or calculates the first three harmonics, however I didn't got this information.Can you please let me know if you know any LabView link which gives these details?ThanksPramod
Sappster
2008-08-06 16:10:12 UTC
Permalink
Hi Pramod,
Here is some information about Harmonic Distortion calculations. Let me know if this doesn't answer your question.
&nbsp;
<a href="http://zone.ni.com/devzone/cda/tut/p/id/3401" target="_blank">http://zone.ni.com/devzone/cda/tut/p/id/3401</a>
pbsalunkhe
2008-08-07 19:40:05 UTC
Permalink
Hi Mark I saw the link and also searched in the developer zone to get other information. It worked for me.I need to measure the max. frequency content in my signal. When I use DAQ Assistant, I have to enter the sampling frequency. In the output graph/chart, it shows Nyquist i.e half the sampling frequency. But how can I check the max. frequency in my signal?ThanksPramod
Sappster
2008-08-08 17:40:08 UTC
Permalink
Hi Pramod,
&nbsp;
By definition Nyquist frequency is the highest frequency you can detect. You will have to increase your sampling frequency to detect higher frequencies. Here is some information about singal acquisition and processing:
&nbsp;
<a href="http://zone.ni.com/devzone/cda/tut/p/id/3216" target="_blank">http://zone.ni.com/devzone/cda/tut/p/id/3216</a>
&nbsp;
Let me know if there is anything else I can help with.

Continue reading on narkive:
Loading...