LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Array Max & Min doesn't find the first maximum

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
Message 1 of 4
(2,573 Views)
Solution
Accepted by topic author franchenstein

Re: Array Max & Min doesn't find the first maximum

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,560 Views)

Re: Array Max & Min doesn't find the first maximum

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
Message 3 of 4
(2,552 Views)

Re: Array Max & Min doesn't find the first maximum

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

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
Message 4 of 4
(2,520 Views)