

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Travaux pratiques traitement de la parole
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


function [F] = spFormantsLpc(a, fs) r = roots(a); r = r(imag(r)>0.01); F = sort(atan2(imag(r),real(r))fs/(2pi)); save spFormantsLpc F; end
function [a P e est_x] = spLpc(x,fs, ncoef) [a P] = lpc(x, ncoef); est_x = filter([0 - a(2:end)],1,x); % Estimated signal e = x - est_x; % Residual signal save spLpc est_x a P e; end
function [F, T, FF] = spFormantsTrackLpc(x, fs, ncoef, frame_length, frame_overlap, window, show) x=wavread('bo_s_14'); fs=22050;
frame_length = 10; frame_overlap = 5; window = 'hamming'; ncoef=24; N = length(x); nsample = round(frame_length * fs / 1000); % convert ms to points noverlap = round(frame_overlap * fs / 1000); % convert ms to points window = eval(sprintf('%s(nsample)', window)); % e.g., hamming(nfft) pos = 1; t = 1; FF= []; F = []; % formants T = []; % time (s) at the frame mid = round(nsample/2); while (pos+nsample <= N) frame = x(pos:pos+nsample-1); frame = frame - mean(frame); a = spLpc(frame, fs, ncoef); fm = spFormantsLpc(a, fs); fm=fm(1:4); FF=[FF fm]; for i=1:4 %i=1:length(fm) F = [F; FF(i)]; % number of formants are not same for each frame T = [T (pos+mid)/fs]; end pos = pos + (nsample - noverlap); t = t + 1; end t=(0:N-1)/fs; subplot(2,1,1); plot(t,x); legend('Waveform'); xlabel('Time (s)'); ylabel('Amplitude'); xlim([t(1) t(end)]); % plot formants trace subplot(2,1,2); plot(T, F, '.'); hold off; legend('Formants'); xlabel('Time (s)'); ylabel('Frequency (Hz)'); xlim([t(1) t(end)]); save spFormantsTrackLpc F T FF; end
Représenter les formants à court-terme.