LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it able to combine my spectrum circuit to my filter circuit?

Solved!
Go to solution

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!

0 Kudos
Message 11 of 21
(994 Views)

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

0 Kudos
Message 12 of 21
(989 Views)

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?

0 Kudos
Message 13 of 21
(985 Views)

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

0 Kudos
Message 14 of 21
(982 Views)

So this means that the x-axis value will not be able to aquire unless using the ramp pattern vi?

0 Kudos
Message 15 of 21
(976 Views)

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

0 Kudos
Message 16 of 21
(973 Views)

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? >.<

0 Kudos
Message 17 of 21
(969 Views)

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

0 Kudos
Message 18 of 21
(945 Views)

Lynn can u do a demo on how to use the ramp vi? Because i dont really understand how a ramp vi works.

0 Kudos
Message 19 of 21
(940 Views)
Solution
Accepted by GG_Jialat

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

0 Kudos
Message 20 of 21
(932 Views)