Commit e11d4bdb authored by Riccardo La Placa's avatar Riccardo La Placa
Browse files

Tolte le m da ni per lasciarli definiti con t0, aggiunto commento sul da farsi...

Tolte le m da ni per lasciarli definiti con t0, aggiunto commento sul da farsi per combinazioni dei ni_s
parent c54c5250
Loading
Loading
Loading
Loading
+24 −31
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ M=fix(t(end)-t(1))/Tseg; %number of segments
%con fix prendo la parte intera, scarto l'ultimo segmento che tanto non
%sarà mai di lunghezza Tseg (molto improbabile)

% Time matrix with bin midpoints for each segment----------------------
% Time matrix with bin midpoints for each segment tm(m,j) ---------------
% tmid(m) is the midpoint in time for the m-th segment
dt = Tseg/N;
tm = zeros(M,N);
tmid = zeros(M,1);
@@ -77,20 +78,17 @@ end
gam = [gamma_max,gamma_min];
singal = zeros(4,1);
singah = zeros(4,1);
nismin = zeros(M,4);
nismax = zeros(M,4);
nismin = zeros(4,1);
nismax = zeros(4,1);
for s = 1:4
    singah(s) = max(sin(gam - s*pi/2));
    singal(s) = min(sin(gam - s*pi/2));
    % Da buttare pure questo
    % This range is computed by finding the maximum span of Equation (15) after varying the search
    % parameters over their respective ranges (given in Table 2). This
    % is done with the exception of ν which is held fixed at its
    % maximum value within sub-bands over the frequency search space.
    for m = 1:M
        nismin(m,s) = f_min*a_min*(Omega_min^s)*singal(s);
        nismax(m,s) = f_max*a_max*(Omega_max^s)*singah(s);
    end
    nismin(s) = f_min*a_min*(Omega_min^s)*singal(s);
    nismax(s) = f_max*a_max*(Omega_max^s)*singah(s);
end

% Try s* and check \nu_s range
@@ -98,40 +96,35 @@ g_jj=((pi*T)^2)/3.*[1; (T^2)/60; (T^3)/1344; (T^4)/172800]; %eq. 22 M2015 + calc
mu_s=0.001; %massimo mismatch sulla griglia coerente da scegliere
s_s=int16(4);
while(1)
    for m=1:M
        if((nismax(m,s_s)-nismin(m,s_s))<delta_ni(mu_s,s_s,g_jj(s_s)))
    if((nismax(s_s)-nismin(s_s))<delta_ni(mu_s,s_s,g_jj(s_s)))
        s_s=s_s-1;
    else
        break;
    end
end
end

%%  Create (...) a coherent template bank in the ν_s(m) space
%%  Create (...) a coherent template bank in the ν_s space
%%  Save this template bank, we'll need it later
% Nni+1 is the number of ni_s^(m) points in the grid (counting borders, 
% Nni is the number of steps) for each s,m couple.
% Nni+1 is the number of ni_s points in the grid (counting borders, 
% Nni is the number of steps) for each s couple.
% We make sure to oversample with respect to eq. 23 M2015 to ensure the max
% mismatch is not exceeded.
Nni = zeros(M,s_s);
for s = 1:s_s
    Nni(:,s) = ceil((nismax(:,s)-nismin(:,s))/delta_ni(mu_s,s,g_jj(s)));
end

% nism is a structure which holds the various vectors of ni_s^(m) (our
% mismatch is not exceeded. -------------
% nis is a structure which holds the various vectors of ni_s^(m) (our
% coherent template bank)
% each nism{m,s} is the array giving the respective grid, and its i-th 
% element is accessed as nism{m,s}(i)
for m = 1:M
% each nis{s} is the array giving the respective grid, and its i-th 
% element is accessed as nis{s}(i)
Nni = zeros(s_s,1);
for s = 1:s_s
        a=nismin(m,s):((nismax(m,s)-nismin(m,s))/(Nni(m,s))):nismax(m,s);
        nism{m,s}=a;
    end
    Nni(s) = ceil((nismax(s)-nismin(s))/delta_ni(mu_s,s,g_jj(s)));
    a=nismin(s):((nismax(s)-nismin(s))/(Nni(s))):nismax(s);
    nis{s}=a;
end

% Resampling the times over nism{m,s} templates
% ---- Andrà fatto per ogni possibile combinazione di nism a un dato m mi
% sa
% Cercheremo un modo per combinare in tutti i possibili modi vettori di 
% vari ni1,ni2,...,nis_s


%Fourier transform on original time-series --------------------------------