17 lines
411 B
Mathematica
17 lines
411 B
Mathematica
|
function [Y, valeurs_tau, valeurs_f] = TFCT(y, f_ech, n_fenetre, n_decalage, fenetre)
|
||
|
|
||
|
Y = buffer(y, n_fenetre, n_fenetre - n_decalage, 'nodelay');
|
||
|
|
||
|
if fenetre == "hann"
|
||
|
f = hann(n_fenetre);
|
||
|
Y = Y .* f;
|
||
|
end
|
||
|
|
||
|
Y = fft(Y);
|
||
|
Y = Y(1:size(Y, 1) / 2 + 1, :);
|
||
|
|
||
|
valeurs_tau = n_decalage / f_ech * (0 : (size(Y, 2) - 1));
|
||
|
valeurs_f = (0:size(Y, 1)-1) * f_ech / n_fenetre;
|
||
|
|
||
|
end
|