Skip to content
Snippets Groups Projects
Commit 4828ae37 authored by LERAYS Camille's avatar LERAYS Camille
Browse files

coucou

parent 2ec3a21e
Branches
No related tags found
No related merge requests found
[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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment