]> git.parisson.com Git - cnaq.git/commitdiff
* Fix length in temporal method
authoryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Fri, 4 Apr 2008 12:54:56 +0000 (12:54 +0000)
committeryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Fri, 4 Apr 2008 12:54:56 +0000 (12:54 +0000)
* Fix spec

git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@165 5fc3e0e6-29bc-4d03-b52b-c088cb822bde

tools/RI_FT.m
tools/get_ri_spec.m
tools/plot_main.m

index ccdb3a9e645cfc4f464f49e722cb1a09a5648580..140f68d60f10704b4abd0a30dbcc6dcffc133a80 100644 (file)
@@ -13,7 +13,7 @@ f1 = f(len_f);
 siginv=fliplr(sig_exc)./f;\r
 ft=fft([sig_mes; zeros(len_f-1,1)]).*fft([siginv; zeros(len_f-1,1)]);\r
 ri=real(ifft(ft));\r
-norm=sqrt(sum(abs(ri.^2))/siz);\r
+norm=sqrt(sum(abs(ri.^2))/len_f);\r
 yeff=norm*sqrt(f_s/2/(f1-f0));\r
 scal=f_s/yeff;\r
 ri=ri*scal;\r
index ee157325ae7cc716f569b7f94d44140aae0f25a0..715bf1130ee6771b7e003eb31b26fd0af93c8208 100644 (file)
@@ -1,6 +1,6 @@
-function [ri, spec] = get_spec_ri(f, sig_exc, sig_mes, f_s)
+function [ri, spec] = get_spec_ri(f, sig_exc, sig_mes, f_s, mes_type)
 % Return the impulse response and the spectrum compute with the given method
-
+    
     if mes_type == 1
         % Frequency method
         [ri, spec] = fonc_trans(f, sig_exc, sig_mes);
index e5c7ffe2800f4901113b0caf1a2228967bde959c..d074330fa36a27acb04d92fed89f0f6edb3d96ef 100644 (file)
@@ -16,7 +16,7 @@ function plot_main(handles)
     mes_type = get(handles.mes_type,'Value');
     
     % Compute excitation spectrum    
-    [rep_imp_exc, spec_exc] = get_ri_spec(f, sig_exc, sig_exc, f_s);
+    [rep_imp_exc, spec_exc] = get_ri_spec(f, sig_exc, sig_exc, f_s, mes_type);
     
     len_spec_exc = length(spec_exc);
     spec_exc = spec_exc(1:len_spec_exc/2);
@@ -27,7 +27,7 @@ function plot_main(handles)
     % Compute all Ris and specs
     for i=1:n_col_sig_mes
         voice = num2str(i);
-        [rep_imp_mes, spec_mes] = get_ri_spec(f, sig_exc, sig_mes(:,i), f_s);
+        [rep_imp_mes, spec_mes] = get_ri_spec(f, sig_exc, sig_mes(:,i), f_s, mes_type);
         len_spec_mes = length(spec_mes);    
         spec_mes = spec_mes(1:len_spec_mes/2);
         % Plot results