Hi,
The reason for delaying the receiving signal after filtering in the Loop Over Pulses section in Monte Carlo ROC simulation is to align the pulse with the template used for detection.
In a typical radar or sonar system, the transmitted pulse is sent out and then the receiver collects the reflected pulses after a certain amount of time. The reflected pulse is delayed with respect to the transmitted pulse due to the time it takes for the pulse to travel to the target and back.
In order to detect the reflected pulse, the receiver needs to align the received pulse with a template pulse that is used for detection. If the received pulse is not properly aligned with the template, the detection performance can be degraded.
In the Monte Carlo ROC simulation, the delay is simulated by delaying the received pulse by a certain amount of time. The matchingdelay variable in the code represents the time delay between the transmitted and received pulse. By delaying the received pulse by matchingdelay samples, the pulse is aligned with the template pulse used for detection, which improves the detection performance.
The buffer function is used to shift the samples of the received pulse by matchingdelay samples and discard the first matchingdelay samples. The remaining samples are then used for detection. The size(rcv_pulses,1) argument in the buffer function specifies the size of the buffer used for shifting the samples.