Detection of noise-corrupted sinusoidal signals with Josephson junctions