LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

spectrum uncontinued signal

Hi.

 

I need to graph the spectrum of the temperature wave (input of a NI 4351 connected to a termocouple) (Vi attached named temperatura.vi)

I did the FFT amplitude and phase spectrum and it visualizes the spectrum in X=0 and Y=frequency (i guess)

 

But i need to graph the frequency of the signal as in the example in the attached VI (vicreate.vi). 

How to do that, using the incoming instrumental signal?
 

 

Thank you

Download All
0 Kudos
Message 1 of 19
(2,557 Views)

someone told me to use filtering and then FFT but what are the possible code to apply to temperatura.vi?

Thank you

0 Kudos
Message 2 of 19
(2,533 Views)

anyone? 😞

0 Kudos
Message 3 of 19
(2,501 Views)

Your question is not completely clear. I do not have the NI435x subVIs so I cannot tell exactly what those are doing.

 

It appears that you have a 2D array coming from the NI435x Read VI.  My guess is that one dimension contains the channels (each channel representing one thermocouple) and the other dimension contains the samples for each channel.

 

To calculate the spectrum of one channel use Index Array to select that channel. ( I cannot tell whether the rows or columns contain channels). The output of Index Array will be a 1D array. Wire that to the Power Spectrum or FFT VI as in your vicreate.vi.  If you want to do multiple channels, do the indexing and psectrum calculations in a loop.

 

You could make a subVI of one of your VIs and put it into the other VI.  Which one becomes the subVI depends on how you will be using this.  Or you vcould make both of them subVIs to a Master VI.

 

Lynn

0 Kudos
Message 4 of 19
(2,485 Views)

To calculate the spectrum of one channel use Index Array to select that channel. ( I cannot tell whether the rows or columns contain channels). The output of Index Array will be a 1D array. Wire that to the Power Spectrum or FFT VI as in your vicreate.vi.  If you want to do multiple channels, do the indexing and psectrum calculations in a loop.

 


That's right but when i use the 1D array seems that it doesn't create a real array but the first value is overwritten every new value is in.

Example:

T=25 -> x(0)=25

T=25,1 -> x(0)=25,1

the other x(i), i!=0, aren't involved in the process.

I can do the spectrum of this signal but it isn't correct (like a spectrum of 1 point, no sense)

 

subVI attached here

0 Kudos
Message 5 of 19
(2,482 Views)

How many samples do you take on each iteration for each thermocouple?  Please post some of your data so that we can see what you are working with.

 

Lynn

0 Kudos
Message 6 of 19
(2,479 Views)

The VI I use is temperatura.vi attached before. I have only 1 termocouple.

I think that every value read by the NI 4351 is written in the 2D array (if I put an indicator of that signal it returns me all 0 values and don't know why, but if I use index array to have 1D array and then a For Cycle with an indicator inside, it returns me the single read value) 

0 Kudos
Message 7 of 19
(2,477 Views)

I am guessing here, but it sounds like the Read VI returns a 2D array regardless of the number of thermocouples or samples per read. It also appears that you are reading one channel and one sample on each read. So you get a 2D array with only one element.

 

To take a spectrum you need to have an array of uniformly sampled (in time) data.  The chart accumulates data so one way is to use a property node to read the chart history.  Note that the spectrum will not be scaled properly unless you include information about the sampling rate. If the sampling is on demand (software timed), there will be jitter which will create errors in the spectral analysis.

 

Here is a modification to your temperatura.vi to show you how to get started. Because I do not have the NI435x VIs, I get lots of errors when I save this.  It should work when you open it with those subVIs available.

 

Lynn

0 Kudos
Message 8 of 19
(2,472 Views)

Thank you very much but i don't see the modified vi attached in your message..

tomorrow morning i'll try it and then i'll report here results 🙂

0 Kudos
Message 9 of 19
(2,470 Views)

It helps if I attach it.

 

Lynn

0 Kudos
Message 10 of 19
(2,458 Views)