Loading scsearch.m +9 −8 Original line number Diff line number Diff line Loading @@ -269,7 +269,6 @@ Lambda = zeros(length(nibank),length(f_gr),M); toc %Fourier transform on original time-series -------------------------------- %per mantenere l'informazione di fase, non faccio il valore assoluto al quadrato della fft tic %for each segment (lavoro su tm) for m=1:M Loading @@ -285,6 +284,8 @@ for m=1:M % F=F(cond); % Y=Y(cond); % X=ifft(Y); %inverse-fourier transf. ttemp = tm(m,:); xtemp = x(m,:); % toc Loading Loading @@ -313,11 +314,11 @@ for m=1:M % end % tic tau = sum((nibank(i,1:s_s)./(nizero*factorial(1:s_s))).*((tm(m,1:N)-tmid(m)).^((1:s_s).').'),2); tau = sum((nibank(i,1:s_s)./(nizero*factorial(1:s_s))).*((ttemp(1:N)-tmid(m)).^((1:s_s).').'),2); % toc % tic X1 = interp1(tm(m,:),x(m,:),tau,'linear',0); X1 = interp1(ttemp(:),xtemp(:),tau,'linear',0); % toc %X1 è la timeseries ricampionata (controllare che sia un vettore colonna) Loading @@ -332,7 +333,7 @@ for m=1:M % tic Y1 = fft(X1).'; clear X1 F1=((0:length(Y1)-1)./(tm(m,end)-tm(m,1))).'; F1=((0:length(Y1)-1)./(ttemp(end)-ttemp(1))).'; % F1=F1(1:round(length(F1)/2)); % Y1=Y1(1:round(length(Y1)/2)); % toc Loading @@ -342,7 +343,7 @@ for m=1:M Y1=Y1(cond); %Calcolo della detection statistic Lambda(i,n,m)=sum(abs(Y1).^2)/sum(x(m,:)); %CREDO (oppure prendono la potenza massima?) Lambda(i,n,m)=sum(abs(Y1).^2)/sum(xtemp(:)); %CREDO (oppure prendono la potenza massima?) % toc end % disp('1ni') Loading @@ -354,11 +355,11 @@ for m=1:M end tic nisearcher = KDTreeSearcher(nibank,'BucketSize',100); % nisearcher = KDTreeSearcher(nibank,'BucketSize',100); %% The line above will have to be substituted with something along the lines %% of the ones below to account for the metric g_jj in the phase derivatives % gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); % nisearcher = ExhaustiveSearcher(nibank,'Distance',@gdistance); gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); nisearcher = ExhaustiveSearcher(nibank,'Distance',gdistance); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% parbank = combinations(porb_gr,a_gr,tasc_gr).Variables; Loading Loading
scsearch.m +9 −8 Original line number Diff line number Diff line Loading @@ -269,7 +269,6 @@ Lambda = zeros(length(nibank),length(f_gr),M); toc %Fourier transform on original time-series -------------------------------- %per mantenere l'informazione di fase, non faccio il valore assoluto al quadrato della fft tic %for each segment (lavoro su tm) for m=1:M Loading @@ -285,6 +284,8 @@ for m=1:M % F=F(cond); % Y=Y(cond); % X=ifft(Y); %inverse-fourier transf. ttemp = tm(m,:); xtemp = x(m,:); % toc Loading Loading @@ -313,11 +314,11 @@ for m=1:M % end % tic tau = sum((nibank(i,1:s_s)./(nizero*factorial(1:s_s))).*((tm(m,1:N)-tmid(m)).^((1:s_s).').'),2); tau = sum((nibank(i,1:s_s)./(nizero*factorial(1:s_s))).*((ttemp(1:N)-tmid(m)).^((1:s_s).').'),2); % toc % tic X1 = interp1(tm(m,:),x(m,:),tau,'linear',0); X1 = interp1(ttemp(:),xtemp(:),tau,'linear',0); % toc %X1 è la timeseries ricampionata (controllare che sia un vettore colonna) Loading @@ -332,7 +333,7 @@ for m=1:M % tic Y1 = fft(X1).'; clear X1 F1=((0:length(Y1)-1)./(tm(m,end)-tm(m,1))).'; F1=((0:length(Y1)-1)./(ttemp(end)-ttemp(1))).'; % F1=F1(1:round(length(F1)/2)); % Y1=Y1(1:round(length(Y1)/2)); % toc Loading @@ -342,7 +343,7 @@ for m=1:M Y1=Y1(cond); %Calcolo della detection statistic Lambda(i,n,m)=sum(abs(Y1).^2)/sum(x(m,:)); %CREDO (oppure prendono la potenza massima?) Lambda(i,n,m)=sum(abs(Y1).^2)/sum(xtemp(:)); %CREDO (oppure prendono la potenza massima?) % toc end % disp('1ni') Loading @@ -354,11 +355,11 @@ for m=1:M end tic nisearcher = KDTreeSearcher(nibank,'BucketSize',100); % nisearcher = KDTreeSearcher(nibank,'BucketSize',100); %% The line above will have to be substituted with something along the lines %% of the ones below to account for the metric g_jj in the phase derivatives % gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); % nisearcher = ExhaustiveSearcher(nibank,'Distance',@gdistance); gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); nisearcher = ExhaustiveSearcher(nibank,'Distance',gdistance); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% parbank = combinations(porb_gr,a_gr,tasc_gr).Variables; Loading