From 4828ae37891a955732fa94e9bb9e2e2725a6f4b4 Mon Sep 17 00:00:00 2001 From: c24leray <camille.lerays@imt-atlantique.net> Date: Fri, 2 May 2025 08:12:15 +0200 Subject: [PATCH] coucou --- SAR.m | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/SAR.m b/SAR.m index 35211ee..35b5d80 100644 --- a/SAR.m +++ b/SAR.m @@ -1,4 +1,23 @@ -[x,fe]=audioread("C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\piano_chord.wav"); -soundsc(x,fe); +[x1,fe1]=audioread("C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano1.wav"); +[x2,fe2]=audioread("C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano2.wav"); +soundsc(x1,fe1); +soundsc(x2,fe2); -X = fftshift(x) +L1 = length(x1) +L2 = length(x2) + +X1 = fftshift(fft(x1)) +X2 = fftshift(fft(x2)) + +f1 = (-L1/2 : L1/2 - 1)*(fe1/L1) +f2 = (-L2/2 : L2/2 - 1)*(fe2/L2) + +figure; +plot(f1, log(abs(X1)),'r'); +hold on; +plot(f2, log(abs(X2)),'b') + +title("spectre") +xlabel("fréquence en Hz") +ylabel("log|X(f)|") +legend(piano1, piano2) -- GitLab