diff --git a/rossignol/parametrique/fluteircam-dsp_max_AR.png b/rossignol/parametrique/fluteircam-dsp_max_AR.png deleted file mode 100644 index ecdc3f6..0000000 Binary files a/rossignol/parametrique/fluteircam-dsp_max_AR.png and /dev/null differ diff --git a/rossignol/parametrique/fluteircam-dsp_max_AR_p100.png b/rossignol/parametrique/fluteircam-dsp_max_AR_p100.png new file mode 100644 index 0000000..6306122 Binary files /dev/null and b/rossignol/parametrique/fluteircam-dsp_max_AR_p100.png differ diff --git a/rossignol/parametrique/fluteircam-dsp_max_AR_p200.png b/rossignol/parametrique/fluteircam-dsp_max_AR_p200.png new file mode 100644 index 0000000..2d19dae Binary files /dev/null and b/rossignol/parametrique/fluteircam-dsp_max_AR_p200.png differ diff --git a/rossignol/parametrique/fluteircam-dsp_max_AR_p4.png b/rossignol/parametrique/fluteircam-dsp_max_AR_p4.png new file mode 100644 index 0000000..cadf7db Binary files /dev/null and b/rossignol/parametrique/fluteircam-dsp_max_AR_p4.png differ diff --git a/rossignol/parametrique/fluteircam-dsp_max_fft.png b/rossignol/parametrique/fluteircam-dsp_max_fft.png index 65e7313..781cff2 100644 Binary files a/rossignol/parametrique/fluteircam-dsp_max_fft.png and b/rossignol/parametrique/fluteircam-dsp_max_fft.png differ diff --git a/rossignol/parametrique/parametrique_fluteircam.m b/rossignol/parametrique/parametrique_fluteircam.m new file mode 100644 index 0000000..9831894 --- /dev/null +++ b/rossignol/parametrique/parametrique_fluteircam.m @@ -0,0 +1,88 @@ +clear; +close all; + +% returns sampling frequency in Hz and data +[y,Fs] = audioread('fluteircam.wav'); + +% Fs = sampling frequency, 32000 for fluteircam.wav +lenW = 0.04*Fs; % window of lenW samples, i.e. 40 ms + +df=0.9765625; %%% la dsp est calcul\'ee tous les df Hz +ff=-Fs/2:df:Fs/2; % length 32769 for fluteircam.wav +ffsub = ff(1:11:end); % compression x11, length 2979 + +tt = (0:length(y)-1)/Fs; +ttsub = (1280/2:1280:length(y))/Fs; + +dsps = zeros(length(ffsub), floor((length(y)-lenW+1)/lenW)); + +% dsp fft +T = 1/Fs; % Sampling period +L = lenW; % Length of signal +t = (0:L-1)*T; % Time vector +fftsp = zeros(L/2+1, floor((length(y)-lenW+1)/lenW)); +f = Fs*(0:(L/2))/L; + +for i = 0:floor((length(y)-lenW+1)/lenW) + + % compute dsp AR + [~, ~, ~, ~, mydsp] = mylevinsondurbin(y(lenW*i+1:lenW*(i+1))',200,Fs); + dsps(:,i+1) = mydsp(1:11:end)'; % compression x11, length 2979 + + % compute dsp fft + myfft = fft(blackman(lenW).*y(lenW*i+1:lenW*(i+1))); + P2 = abs(myfft/L); + P1 = P2(1:L/2+1); + P1(2:end-1) = 2*P1(2:end-1); + fftsp(:,i+1) = P1; +end + +% take only positive frequencies for dsp +ffsubp = ffsub(1,(length(ffsub)-1)/2+1:end); +dspsp = dsps((length(dsps)-1)/2+1:end,:); + +% plot +figure() +plot(tt,y) +xlabel('temps (s)') +ylabel('amplitude (u.a.)') +title('signal fluteircam') + +figure() +surf(ttsub,ffsub,dsps,'EdgeColor','None'); +xlabel('temps (s)') +ylabel('fréquences (Hz)') +zlabel('amplitudes (u.a.)') +title('Full DSP AR signal fluteircam') + +figure() +surf(ttsub,ffsubp,dspsp,'EdgeColor','None'); +xlabel('temps (s)') +ylabel('fréquences (Hz)') +zlabel('amplitudes (u.a.)') +title('DSP AR signal fluteircam') + +figure() +surf(ttsub,f,fftsp,'EdgeColor','None'); +xlabel('temps (s)') +ylabel('fréquences (Hz)') +zlabel('amplitudes (u.a.)') +title('DSP FFT signal fluteircam') + + +% take max amplitude frequency +[maxDspsp, maxIndDspsp] = max(dspsp); +maxFfsubp = ffsubp(maxIndDspsp); +figure +plot(ttsub,maxFfsubp) +xlabel('temps (s)') +ylabel('fréquences (Hz)') +title('Frequency max DSP AR signal fluteircam') + +[maxFftsp, maxIndFftsp] = max(fftsp); +maxF = f(maxIndFftsp); +figure +plot(ttsub,maxF) +xlabel('temps (s)') +ylabel('fréquences (Hz)') +title('Frequency max DSP FFT signal fluteircam')