MATLAB: Findpeaks outputs random values for distant targets!!

antennacommunicationsfindpeaksfmcwfrequencyphased arrayPhased Array System Toolboxradartransmitter

I am working on Frequency Modulated Continuous Wave (FMCW) radar which linearly modulate frequency according to the amplitude of a sawtooth. My model is capable of detecting target ranging from 0.5m to 300m. The signal processor block is coded to provide 4 maximum peaks through 'findpeaks' and thereby 2 targets placed at different distances. Technically it should give me two peaks at respective frequencies and thus calculating distances. function but when I set one target at 1m and the other at 299m it gives accurate distance for 1m target but not for 299m object. Scenario 2 : 1st target 250m and second target 299m, it gives accurate results for both targets. I think my code is correct but I cannot isolate the problem. Help is appreciated , attached is my model and the code.

Best Answer

Haven't got chance to run your model. But what is the wrong value it reports when the target at 299m is not detected? Is it very close to 1 m? If so, this may due to the return of the 1m target much stronger than that of the 299m target, so you are essentially getting the sidelobe of the first target.
HTH