Changed the phase values for 'nc' and 'c' to get the  difference in indexes between the first peak found and the preceding peak.