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?
Solved! Go to Solution.
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?
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!
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.