% Measures the minimum execution time of Volterra kernel calculation using
% SVD and BLAS functions.
%
% Discrete-time Volterra kernels of the cascade of ideal
% discrete/continuous (D/C) converter, integrator, loudspeaker A and ideal
% C/D converter.

% CBVK Toolbox
% JHMG, PMSB 2016


clear

m=4;        % Dimension
P=4;        % Expansion order
N=100;      % Memory length
Fs=5000;    % Sampling frequency
rep=20;     % Number of repetitions for greater precision of execution
            % time measurement

arq1='CB_Aitgr_P4';                 % CB file            
arq2='mVK_svd_blas_Aitgr_P4_N100';  % Output file

%------------------------------------------


% Carleman Bilinearization 
load(arq1);

% Kernels

dt=zeros(1,rep);
for i=1:rep
    tic
    % Kernels of integrator + loudspeaker
    kernels = vkrnsvdx(F,G,b,c,N,1/Fs,m,P);

    
    dt(i)=toc;
    fprintf('%g\n ', dt(i));
end
min(dt)
%save(arq2,'dt');


