Fixed some print statements

This commit is contained in:
Jono Targett 2024-05-29 22:07:16 +09:30
parent cd83d1683b
commit bed653fa0e

View File

@ -18,13 +18,12 @@ if __name__ == '__main__':
if len(data.shape) == 2:
data = data.mean(axis=1)
# Normalise
print(np.max(data))
# Coarse normalisation
data = data / np.max(data)
# TODO JMT: Find out why the correlation step fails when max frequency <= 2 * nyquist rate
data, sample_rate, decimation = anti_alias(data, sample_rate, 4800)
print(f'Length after decimation: {len(data)} samples (/{decimation}, {sample_rate})')
print(f'Length after decimation: {len(data)} samples (/{decimation}, {sample_rate} Hz)')
pure_signals = {tone:note(freq, pure_sample_length, rate=sample_rate) for tone,freq in TONES.items()}
correlations = {tone:np.abs(signal.correlate(data, pure, mode='same')) for tone,pure in pure_signals.items()}