0001 function sig = leansynth(vt,data); 0002 0003 data.Af = [];data.dx = []; 0004 for i=1:size(data.X,2), 0005 [F,B,A,Af] = doAM(data.X(:,i)); 0006 data.Af(:,i) = Af(1,:)'; 0007 data.dx(:,i) = Af(2,:)'; 0008 %data.Af(:,1) = Af(1,:)'; 0009 %data.Af(:,2) = Af(1,:)'; 0010 %data.dx = mean(Af(2,:)); 0011 end; 0012 0013 % Determine the dimensionality of the area functions 0014 %n = size(data.Af,2); 0015 0016 % Initialize all parameters for vtsynth - [note the transpose] 0017 Ag0 = data.Ag0'; 0018 AgP = data.AgP'; 0019 F0 = data.F0'; 0020 0021 TAF1 = data.TAF1; 0022 TAF2 = data.Af; 0023 0024 % call vtsynth to generate the signal 0025 %if isfield(data,'fs'), 0026 [sig] = vtsynth(size(data.Af,1),Ag0,AgP,F0,TAF1,TAF2,data.dx,data.fs); 0027 %else, 0028 %[sig] = vtsynth(size(data.Af,1),Ag0,AgP,F0,TAF1,TAF2,data.dx); 0029 %end 0030 0031 % In order to reduce clicks we are multiplying the signal by a voicing 0032 % component defined by the minimum of the area function at each point 0033 %AV=interp1(linspace(1,length(sig),n),min(data.Af)>0.1,1:length(sig))'; 0034 %sig = sig.*AV; 0035 0036 %sig = min(max(sig,-1),1);