diff --git a/empreinte_ac.mat b/empreinte_ac.mat new file mode 100644 index 0000000000000000000000000000000000000000..813112aa851768cfec53dc808d887032c417d7c5 Binary files /dev/null and b/empreinte_ac.mat differ diff --git a/example_with_wave_file.m b/example_with_wave_file.m new file mode 100644 index 0000000000000000000000000000000000000000..e288ffce5280fbee6268f915d49b999fd7d6082e --- /dev/null +++ b/example_with_wave_file.m @@ -0,0 +1,12 @@ +%% this is a simple example to read and play a wave file with matlab + +% set a string variable to a wave filename we want to open: +toneFileName = "wav/single_tone_piano1.wav"; +% read the content of the wave file: +[data,fe] = audioread(toneFileName); +% data is a matrix with 2 columns if the sound is stereo; keep the mono to ease further processing +data = data(:,1); +% get the number of sample in vector data +N = length(data); +% play the sound in the audio output: +soundsc(data,fe); \ No newline at end of file diff --git a/signal_excitation.mat b/signal_excitation.mat new file mode 100644 index 0000000000000000000000000000000000000000..3cb1b3eceba9c5fd2bbc8b31fbe33ffdd7cfe1ba Binary files /dev/null and b/signal_excitation.mat differ diff --git a/simule_piece.m b/simule_piece.m new file mode 100644 index 0000000000000000000000000000000000000000..717c5bb63786b67d87c2e0987d2b267bfe48425b --- /dev/null +++ b/simule_piece.m @@ -0,0 +1,14 @@ +function [ y ] = simule_piece( x,fech ) +%ENTREE : x=signal émis par le haut-parleur +% fech=fréquence d'échantillonnage de x +%SORTIE : y=signal capté par le microphone dans la pièce +%% + +load('empreinte_ac') +if fech~=fe, error('Fréquence d''échantillonnage incorrecte'), end +empreinte=empreinte(1:80000); +y=conv(x,empreinte); + + +end +