LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Max & Min doesn't find the first maximum

Solved!
Go to solution

Hi,

 

I am developing an OFDM system for NI USRP and I am trying to do the Schmidl-Cox Algorithm for frame and frequency offsets correction. At a given point, I need to find the index of the first maximum value of an array. This array has an increasing value until it reaches 1 and stays constant. The first 1 occurs in position 12. But the output I'm getting from the Array Max & Min block is 76. This is neither the first nor the last 1 in that array. And I have no idea why I'm getting the wrong index.

Have anyone exprienced this kind of situation before?

Greetings,
Dan Franch
Student Space Programs Laboratory
Pennsylvania State University
0 Kudos
Message 1 of 4
(2,758 Views)
Solution
Accepted by franchenstein

Can you attach a small example containing your array as diagram constant?

My guess is that the values still differ by very small amounts. Try to show at least 14 digits, depending on datatype.

 

What happens if you subtract the found max from the array? Are the earlier results very slightly negative?

Message 2 of 4
(2,745 Views)

That was exactly the problem. There is some kind of small divergence after the 18th digit. It is probably something with my implementation. I will have to reivse it.

Thank you very much!

Greetings,
Dan Franch
Student Space Programs Laboratory
Pennsylvania State University
0 Kudos
Message 3 of 4
(2,737 Views)

@franchenstein wrote:

It is probably something with my implementation.


Not likely.  That's an issue with floating point numbers in general.  Every computer language has this problem.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,705 Views)