01-15-2013 06:51 PM
Hi lynn
What should i use to convert the cluster of 3 element to a 2D array? I am kind of confused. Is it possible for u to do a demo for me? Thanx!
01-15-2013 06:57 PM
You use the Unbundle by Name primitive as I showed in the image in message 6 of this thread. The magnitude output is a 1D array of Doubles.
Lynn
01-15-2013 07:15 PM
But lynn the value i wan is not the y-axis value. The value i am interested in is the x-axis value. So what can i do to extract the x-axis value?
01-15-2013 07:44 PM
I misunderstood. The X-axis values are not explicitly stored. They are uniformly spaced and can be calculated from the fo and df values. Read the detailed help files for thePower Spectrum VI and the Fourier Transform VI for complete information on the frequency bin values.
The Ramp.vi (in the Signal Processing palette, I think) may be useful if you need to generate an array of x-values.
Lynn
01-15-2013 07:52 PM
So this means that the x-axis value will not be able to aquire unless using the ramp pattern vi?
01-15-2013 08:05 PM
I am not sure what you mean.
The process of calculating the spectrum uses the Fourier Transform. The requirement is that the input samples are uniformly spaced in time, and the the absolute start time does not make any difference. The spectral output is then uniformly spaced in frequency from zero to the Nyquist frequency. However, the algorithm used by the FFT VIs does not actually know what the time spacing of the input samples actually is. There is no place in the calculation of the spectrum where the actual frequency values is ever used or calculated - so there is nothing to "acquire."
You can also easily calculate the x-array with a for loop if you do not want to use the Ramp.vi.
Lynn
01-15-2013 08:43 PM
Lynn i think u misunderstood my question. Put it simple is that am i able to extract the value of x-axis to a spreadsheet or a txt file? >.<
01-16-2013 01:22 PM
To save the values, you need to generate them. Use Ramp.vi to get X-values and your spectrum function for the Y-values. Combine them into a 2D array and use Write to Spreadsheet File.vi.
Lynn
01-16-2013 06:43 PM
Lynn can u do a demo on how to use the ramp vi? Because i dont really understand how a ramp vi works.
01-16-2013 07:37 PM
The detailed help file explains the way the function works and the definitions of the controls and indicators.
Here is a modification of your leads.v to show how it could be done. You do not need the XY graph but I put it there to show the similarity between the spectral display you have and what the X-Values produce.
Lynn