06-12-2009 05:11 AM
Hi Keith Tan
I think your problem is basic Labview knowledge. My advise to you is to use the Example finder under help in the toolbar. Also then you start every Labview session you enable context help by typing ctrl+h. We have all been new to Labview some time. So that is OK. But I still think you could be better on using the built in help tools an the shipping examples. Also I think this is school project. And not work related. That it also OK. But you should have mentioned it.
06-12-2009 09:38 AM
Keith Tan wrote:The next part will be doing FFT. I still couldnt get the result after passing through the FFT function.
What are you doing, and what are you getting?
06-14-2009 08:12 PM
Hi to all,
I guess I have offended someone along the way. Nevertheless, just to clear the air, I am a research engineer in a state owned research centre. Therefore it's not a school project.
Currently I am involved in a major project. One of the part I am assigned to do is to is to design a program using labview to control the VXCO of a circuit. The purpose of my project is to regulate the voltage of the VXCO so as to reach an optimum frequency level.
As such, I will be using PXI-6552 with external ADC and DAC chips(as 6552 cannot supply conversion between digital and analog). The purpose of the labview, 1) will be continuous accquiration of 10bits data from the ADC chip of the sine wave waveform ,
2) convert this every 10bits of binary data back to decimal ,
3) determine the frequency of the sine wave using FFT
4) set the regulated voltage and pump it back to DAC chip so as to regulate VXCO
As this is my first time using labview, I have been exploring labview built in programs and the cltr-h offered in the program regularly for the past few weeks. Unfortunately, the deadline for the project is 3 weeks away, therefore I have decided to approach the labview community for help.
I have been trying my best to learn as i work, as eventually I have a job to upkeep.
As for smercurio_fc question:
I am trying to do FFT from the sequence of decimal number I have generated. Here's a very simplified conceptual .VI of what I would like to achieve in labview. The while loop is to just to indicate the continuous accquiring of the 10bits data, while the conversion of the binary to decimal is done by Not equal to 0? and boolean array to number and the last block will be FFT function.
My entire concept of the program is exactly what you have mentioned in the previous reply. Yes, you are right that for my FFT operation, I will have an array of value to feed into the FFT function block, and those values will be the decimals that I have converted. And Yes, you are right that the values will be scaled.
I really apprecipate the help I had been getting over the weeks, ultimately, all the member are volunteers to the community.
I had been and, will continue to be respectfully to all members to the community.
Once again, I will like to apologise for any misunderstandings that was caused
Thanks and Regards
Keith Tan
06-14-2009 09:31 PM
Keith,
Sound like you're trying to make a PLL. Keep in mind that you're doing a lot of processing in the loop so you're not going to get any sort of decent phase noise out of the response.
that being said, if you're acquiring a continuous time signal from the ADC then all you need to do is use the LabVIEW tools to correctly map your U32 to the 10bit words (LSB in the 0th position). I like using the U32 to boolean array followed by an index and build array functions. then you can feed the samples directly into the FFT functions in the signal processing pallette. If you're looking for the fundamental frequency, I would probably recommend the extract single tone vi. if you run the FFT you'll get back the whole spectrum but you're only interested in the fundamental (I assume).
06-14-2009 10:58 PM
Keith Tan wrote:Hi to all,
I guess I have offended someone along the way. Nevertheless, just to clear the air, I am a research engineer in a state owned research centre. Therefore it's not a school project.
I don't believe anyone has been offended. I certainly haven't. We're just asking questions to try to understand what you are trying to accomplish.
if you're acquiring a continuous time signal from
the ADC then all you need to do is use the LabVIEW tools to correctly
map your U32 to the 10bit words (LSB in the 0th position). I like
using the U32 to boolean array followed by an index and build array
functions.
I think that's backwards from what Keith has. He's starting with an array of integers which are zeros and ones, indicating a 10-bit pattern, and he's converting this to a number. This number is a scaled value.
@Keith:
In your conceptual VI you would need to auto-index the while loop. As you have it you only ever get the last value out of the loop. Then output of the loop would be an array of integers (you would not need the Build Array outside the loop). You would need to convert this to the actual floating point values to get the "real" values. If the signal is a simple periodic then I would agree that you may be able to get away with just using the Extract Single Tone VI. You may, however, need to create a waveform datatype. I don't remember if the 7.1 version accept an array of numbers. Note that with the way you're using the FFT VI, peeling off the first element of the output will not give you the fundamental frequency. The first element is the DC component. If you're not familiar with FFT you may wish to read this document: The Fundamentals of FFT-Based Signal Analysis and Measurement in LabVIEW and LabWindows/CVI.
06-14-2009 11:15 PM
After re-reading your last post I realized that you really need to change your conceptual VI. Based on your description you are trying to do the analysis while the data is being collected. Your conceptual VI will not do that. Keep in mind how this is going to work: You will have a loop and in each loop you take a sample. One sample is obviously not enough to be able to determine the frequency of the signal and calculate a regulation voltage. That means you need to acquire values (i.e. build an array) until you have a certain amount and then you can calculate the frequency and the regulation voltage. At that point your program will keep running, with each iteration taking another sample. At this point you need to determine how to proceed: (a) keep adding to the array; (b) make the array a sliding window; (c) start up a new array and wait until you have enough samples to determine the signal frequency and the new regulation voltage.
Which method makes sense for your system? How fast does the frequency of the signal that you're monitoring change?
06-14-2009 11:54 PM
Hi Guys,
Thanks very much for the fast replies. Ok, I will try to look into all the suggestions that you guys mention. Will study on the suggestions today and post back any problems by tomorrow.
Thank you guys! Have a nice day!
Keith Tan
06-15-2009 02:18 AM
06-18-2009 09:57 PM - edited 06-18-2009 09:59 PM
Hi there, Sorry for the very late reply. Over the week, I was brushing up on my understanding of array and FFT, hopefully I am more competent in labview than before.
At currently stage , I have successfully plot out the complete sine wave that had been converted from the ADC chip that I am using, all thanks to the help of the community. The reason why I wanted to plot of sine wave is to verify that both my connections in the ADC chip and the labview VI that I am using, are working correctly.
Now that I had verified that everything is working, I can now move on the main part of the program, which is to get the frequency of the waveform pump into my ADC chip.
I have auto indexed the while loop so that I will be getting an array of data instead of only the last data. With this set of array, I started pumping it into the FFT.vi function block given in labview. But I got stuck after that as I dont know what to do with the processed array of data. I tried to use extract single tone.Vi but it didnt work out. Are there no way to get the frequency information of the sine wave without using waveform data type? I notice many of the FFT function block requires the input of time signal and not data array.
I was able to change my accquired data to waveform data type just by changing one of the options. But after changing it, I have broken wire over that the conversion part, where I convert the 10 bits binary data to decimal?
So now my main question would be
1. Do i really need to use waveform data type in order to find the frequency of the signal?
2. If I were to use waveform data type, how do I still maintain the conversion of every 10bits to decimal?
To answer some of the question posted
Coq rouge : The 10bits data will not be signed, it's unsigned number. Therefore, I managed to save some time here.
Smercurio_fc : Most likely I will be doing option (a), which is to keep adding array. But then I will only need to accquire one or two complete signal as the signal coming in will be periodic. The frequency of the signal will be within the range of 1khz to 10khz.
I had tried my best to understand the program but apparently I am still unable to solve these problems.
Thanks for the help guys
Keith Tan
06-19-2009 04:30 AM
Keith Tan wrote:So now my main question would be
1. Do i really need to use waveform data type in order to find the frequency of the signal?
2. If I were to use waveform data type, how do I still maintain the conversion of every 10bits to decimal?
If you want to slim your program try the to use the standard signal processing VIs. In your case that will be the "auto power spectrum.vi" All you need then is a signal array and the dt value.
Have you given the sampling frequency some thought, you are aware things like the Nyquitst frequency? Also then you are creating your output signal, to get a good waveform use at least a update rate 10X your signal frequency