Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Viterbi_Sideband
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ling Sun
Viterbi_Sideband
Commits
21c5f04b
Commit
21c5f04b
authored
8 years ago
by
Ling Sun
Browse files
Options
Downloads
Patches
Plain Diff
adjust variable names, minor changes
parent
72f727e6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
binaryfilter.m
+13
-12
13 additions, 12 deletions
binaryfilter.m
functions/argmax.m
+2
-2
2 additions, 2 deletions
functions/argmax.m
readfstats.m
+6
-7
6 additions, 7 deletions
readfstats.m
search_O1.m
+13
-12
13 additions, 12 deletions
search_O1.m
viterbi_colFLT.m
+15
-11
15 additions, 11 deletions
viterbi_colFLT.m
with
49 additions
and
44 deletions
binary
_fstat
.m
→
binary
filter
.m
+
13
−
12
View file @
21c5f04b
function
[
b
,
h
]
=
binary
_fstat
(
f
,
f0
,
P
,
a0
)
% Generate the Bessel-weighted matched filter (also generate Comb filter)
function
[
b
,
h
]
=
binary
filter
(
f
,
f0
,
P
,
a0
)
%
BINARYFILTER
Generate the Bessel-weighted matched filter (also generate Comb filter)
%
% Inputs:
% f - Frequency bin list (i.e. hidden stats)
...
...
@@ -11,9 +11,10 @@ function [b,h] = binary_fstat(f,f0,P,a0)
% b - Bessel-weighted matched filter
% h - Comb filter (not used in the current search)
% Fstat power concentrated at [-c c]/P where c = 2*pi*a0*f0
% f0 is fixed to setup matched filter for each 1-Hz sub-band
c
=
(
2
*
pi
*
a0
*
f0
)
;
c
=
2
*
pi
*
a0
*
f0
;
% Make it slightly wider than c
N
=
ceil
(
c
)
+
100
;
n
=
-
N
:
N
;
...
...
This diff is collapsed.
Click to expand it.
functions/argmax.m
+
2
−
2
View file @
21c5f04b
This diff is collapsed.
Click to expand it.
readfstats.m
+
6
−
7
View file @
21c5f04b
function
[
f
,
X
,
N
,
T
]
=
readfstats
(
dirName
,
startFreq
,
steps
)
% Read Fstat files
%
READFSTATS
Read Fstat files
%
% Inputs:
% dirName - Directory of Fstat files
...
...
@@ -13,9 +13,8 @@ function [f,X,N,T]=readfstats(dirName, startFreq, steps)
% N - Number of bins
% T - Total number of steps
d
=
dir
(
dirName
);
X
=
[];
X
=
[];
for
n
=
1
:
steps
fileName
=
[
'Fstat-'
num2str
(
startFreq
)
'-'
num2str
(
n
-
1
)
'.dat'
]
...
...
This diff is collapsed.
Click to expand it.
search_O1.m
+
13
−
12
View file @
21c5f04b
function
search_O1
(
freq
,
idx
)
% This script is for O1 Sco X-1 search.
%
SEARCH_O1
This script is for O1 Sco X-1 search.
% The search is separated into parallel 1-Hz sub-jobs.
% The start frequency for each sub-job is the overal start frequency plus job index.
%
...
...
@@ -11,6 +11,7 @@ function search_O1(freq,idx)
% Outputs:
% Save output files to the output directory.
format
long
g
startFreq
=
str2num
(
freq
)
+
str2num
(
idx
)
...
...
@@ -21,7 +22,7 @@ outdir = '/home/ling.sun/O1/Viterbi/output/';
outfile
=
strcat
(
outdir
,
'Viterbi-'
,
num2str
(
startFreq
),
'.dat'
)
% Set parameters
a
=
1.44
a
0median
=
1.44
P
=
68023.70496
steps
=
13
...
...
@@ -32,13 +33,14 @@ toc
fmean
=
f
(
1
)
+
0.5
;
% Take the mean value of each 1-Hz sub-band
g
=
[
-
0.1
:
0.01
:
0.1
];
% asini grid (+/-10% uncertainty, may search larger uncertainty)
a0
=
(
1
+
g
)
*
a
;
% asini values being searched
a0
=
(
1
+
g
)
*
a
0median
;
% asini values being searched
for
m
=
1
:
length
(
g
)
disp
(
sprintf
(
'a0=%g'
,
a0
(
m
)))
tic
% Generate Bessel-weighted matched filter
[
b
,
h
]
=
binary
_fstat
(
f
,
fmean
,
P
,
a0
(
m
));
[
b
,
h
]
=
binary
filter
(
f
,
fmean
,
P
,
a0
(
m
));
% Compute Bessel-weighted Fstat
for
n
=
1
:
steps
...
...
@@ -46,7 +48,6 @@ for m=1:length(g)
end
[
path0
(
m
,:),
delta
,
psi
,
sc
(
m
)]
=
viterbi_colFLT
(
3
,
Y
);
toc
end
...
...
This diff is collapsed.
Click to expand it.
viterbi_colFLT.m
+
15
−
11
View file @
21c5f04b
function
[
path
,
delta
,
psi
,
score
]
=
viterbi_colFLT
(
M
,
obslik
)
% VITERBI Find the most-probable (Viterbi) path through the HMM states (frequency bins).
% VITERBI
_COLFLT
Find the most-probable (Viterbi) path through the HMM states (frequency bins).
%
% Inputs:
% M - One dimension of the colfilt matrix, in the current model M=3,
...
...
@@ -15,7 +15,10 @@ function [path,delta,psi,score] = viterbi_colFLT(M, obslik)
% of paths to all the states at the final step
if
round
(
M
/
2
)
==
M
/
2
M
=
M
+
1
;
end
if
round
(
M
/
2
)
==
M
/
2
M
=
M
+
1
;
end
[
Q
,
T
]
=
size
(
obslik
);
% Q bins, T steps
delta
=
zeros
(
Q
,
T
);
...
...
@@ -28,9 +31,10 @@ path = zeros(1,T);
% compares all three possible paths for each step and the operation
% is efficient.
cor
=
(
0
:
Q
-
1
)
'-
(
M
-
1
)/
2
;
% correction term for each bin
t
=
1
;
delta
(:,
t
)
=
obslik
(:,
t
);
cor
=
(
0
:
Q
-
1
)
'-
(
M
-
1
)/
2
;
% correction term for each bin
disp
(
'forward'
)
for
t
=
2
:
T
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment