targets = {"audio1.wav", "audio2.wav", "audio3.wav", "audio4.wav"}; freqs = {522.8, 259.9, 253.1, 515.0}; for i = 1:length(targets) target = targets{i}; disp(sprintf("Analysing file %s", target)) freq = freqs{i} [sf, t, k, S, FS] = load_audio(target); S = S(:,1); sin_check = 0.25 * sin(2 * pi * freq * t); FS_check = fftshift(mydft(sin_check)); input("Data sound") sound(S, sf); input("Check sound") sound(sin_check, sf); figure grid on hold on title(sprintf("Check %s, Fourier Transform", target)) xlabel('Frequency') ylabel('Fourier transform of the signal') plot(k, abs(FS), 'DisplayName', target) plot(k, abs(FS_check), 'DisplayName', 'check') hold off lgd = legend end