LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Max

Hi there,

 

I am trying to find the maximum point of the Fourier transform function using the Array max&min function (picture below). However these seems to be a problem with connections both at the input and output of the Array max function. Any ideas how to resolve this problem?

Thanks in advance!

Screenshot 2019-02-01 at 14.31.48.png

0 Kudos
Message 1 of 10
(3,065 Views)

Why are you taking a 1-D array, then building it into a 2-D array, only to wire it into a function and indicator designed to accept 1-D arrays?

 

What is the Output terminal connected to?  The broken wire there is not clear as to where it is connected.

 

Get rid of the Build Array before the broken wire.

0 Kudos
Message 2 of 10
(3,055 Views)

Hi RavensFan,

 

Even without the build array function there is still a problem with the connection. Attached pic.

.Screenshot 2019-02-01 at 14.44.11.png

0 Kudos
Message 3 of 10
(3,051 Views)

Either hover over the broken wire to see whats wrong or press ctrl+B to remove the broken wires and then reconnect and see when it breaks to understand what breaks it. From the pic, nothing looks wrong so something is incorrectly connected. Or post a snippet or VI so we can test and help.

Certified LabVIEW Architect
0 Kudos
Message 4 of 10
(3,047 Views)

Hi thols,

 

I have removed and reconnected the wires multiple times and in different points but the issue wasn't resolved. I attach my program so that you could have a look if you have some time. Thanks in advance!

0 Kudos
Message 5 of 10
(3,044 Views)

Hovering over the broken wire gives a hint:complex.PNG

So I disconnected the wire going to array min/max and it works. Min/max does not take complex data. The other outputs gets coercion dots. The array output can be changed to CDB-representation. See what happens if the graph data displays correct, it was long ago I used CDB.

Certified LabVIEW Architect
0 Kudos
Message 6 of 10
(3,034 Views)

Hi thols,

 

Thanks for your time! yes I had noticed that if I removed the array max function the remaining part works. However, the main purpose of my program is to identify the max point of the fft. Can a fft have complex data??? Actually I checked now the data and they are real numbers. Any ideas why the array max function doesn't work?

0 Kudos
Message 7 of 10
(3,028 Views)

An FFT can generate complex data because it will contain the magnitude and phase information.

But what does MAX mean for a complex number?  That's why Array Max and Min doesn't take it.

What does MAX mean to you?  Do you want it to be to be the just the Max of the Real part?  Or do you want it to be the max of the combined Real/Imaginary part?

 

Look at the functions on the Complex number palette to break out the Real part, or get the part that represents the length of the complex vector.  Then you can take the Array Max of that.

Message 8 of 10
(3,014 Views)

Hello,

 

I currently trying to input complex data from an array to the array max min function. However, an error appears in the connection between these two saying that the type of course is1D subarray of double complex while the type of sink is 1D of type double (if I disconnect the max min function then the connections between the index array and the waveform data and output array 6 are okay). The purpose of my program is to find the maximum point of the Fourier transform function and to find at which frequency this occurs (this part is my second question as I don't really know how from the array max min I can find the frequency at which the max point occurs).

 

Thanks in advance! I am attaching my code and some pictures as well.Screenshot 2019-02-01 at 14.44.11.png 

0 Kudos
Message 9 of 10
(2,992 Views)

If you input a 2D array to the FFT.vi, it calculates a 2D Fast Fourier transform, and the results are in terms of spatial frequencies, not time. The FFT is a mathematical transformation that does not directly give you the amplitude as a function of frequency.

 

If you are looking for the maximum time frequency, you are better off using the "Amplitude and Phase Spectrum.vi". The input arrays are 1D, i.e. amplitude as a function of a constant time step.

Marc Dubois
0 Kudos
Message 10 of 10
(2,979 Views)