Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AMPS
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
Grant David Meadors
AMPS
Commits
4750d36b
Commit
4750d36b
authored
12 years ago
by
Grant David Meadors
Browse files
Options
Downloads
Patches
Plain Diff
Updated and made statistics
parent
1eed1e34
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrastBeforeAfterAmplitude.m
+42
-4
42 additions, 4 deletions
contrastBeforeAfterAmplitude.m
fullspectBoth.m
+6
-5
6 additions, 5 deletions
fullspectBoth.m
fullspectDiff.m
+7
-6
7 additions, 6 deletions
fullspectDiff.m
with
55 additions
and
15 deletions
contrastBeforeAfterAmplitude.m
+
42
−
4
View file @
4750d36b
...
...
@@ -13,19 +13,29 @@ afterRaw = load('S6H1_Hann_40_2000feedforward_bins.txt');
% Our object is to average all the calibrated amplitude rows corresponding
% to a given SFT number.
beforeL
=
unique
(
beforeRaw
(:,
1
));
afterL
=
unique
(
afterRaw
(:,
1
));
% The text file is zero-indexed
beforeL
=
sort
(
unique
(
beforeRaw
(:,
1
)));
afterL
=
sort
(
unique
(
afterRaw
(:,
1
)));
before
=
ones
(
size
(
beforeL
));
after
=
ones
(
size
(
afterL
));
% Average over all the bins corresponding to a given SFT number,
% then multiply by sqrt(8/3) because of the Hann window normalization factor.
% Have to shift index on the right-hand side, to compensate for
% Matlab's one-indexing vs the C-generated text file's zero-indexing
for
ii
=
1
:
length
(
before
)
before
(
ii
)
=
sqrt
(
8
/
3
)
*
mean
(
beforeRaw
(
beforeRaw
(:,
1
)
==
ii
,
4
));
before
(
ii
)
=
sqrt
(
8
/
3
)
*
mean
(
beforeRaw
(
beforeRaw
(:,
1
)
==
ii
-
1
,
4
));
end
for
ii
=
1
:
length
(
after
)
after
(
ii
)
=
sqrt
(
8
/
3
)
*
mean
(
afterRaw
(
afterRaw
(:,
1
)
==
ii
,
4
));
after
(
ii
)
=
sqrt
(
8
/
3
)
*
mean
(
afterRaw
(
afterRaw
(:,
1
)
==
ii
-
1
,
4
));
end
% Strip any NaN -- but there should not be any
before
(
isnan
(
before
))
=
[];
after
(
isnan
(
after
))
=
[];
clear
beforeRaw
clear
afterRaw
figure
(
1
)
semilogy
(
beforeL
,
before
,
afterL
,
after
)
...
...
@@ -43,6 +53,7 @@ differenceClean = difference;
differenceClean
(
isnan
(
difference
))
=
[];
arithmean
=
mean
(
differenceClean
)
*
ones
(
size
(
difference
));
arithmeanString
=
horzcat
(
'Arithmetic mean of difference: '
,
num2str
(
arithmean
(
1
)));
length
(
difference
)
figure
(
2
)
plot
(
beforeL
,
difference
,
beforeL
,
arithmean
)
...
...
@@ -57,3 +68,30 @@ ylim([-1e-24 1e-24])
print
(
'-dpdf'
,
'HannAmpDiff.pdf'
)
print
(
'-dpng'
,
'HannAmpDiff.png'
)
close
(
2
)
% Try some statistics
HoftHistVector
=
1e-24
*
(
50
:
100
);
beforeHist
=
hist
(
before
,
HoftHistVector
);
afterHist
=
hist
(
after
,
HoftHistVector
);
arithmeanBefore
=
mean
(
before
);
arithmeanAfter
=
mean
(
after
);
arithmeanDifference
=
arithmeanBefore
-
arithmeanAfter
;
harmmeanBefore
=
harmmean
(
before
);
harmmeanAfter
=
harmmean
(
after
);
harmmeanDifference
=
harmmeanBefore
-
harmmeanAfter
;
harmmeanString
=
'Harmonic mean: before, after, difference'
;
figure
(
3
)
plot
(
HoftHistVector
,
beforeHist
,
HoftHistVector
,
afterHist
)
xlabel
(
'Hoft'
)
ylabel
(
'Histogram count'
)
legend
(
'Before feedforward'
,
'After feedforward'
)
title
({
'Hann windowed calibrated amplitude histogram'
;
...
harmmeanString
;
...
num2str
(
harmmeanBefore
);
num2str
(
harmmeanAfter
);
num2str
(
harmmeanDifference
)})
grid
on
print
(
'-dpdf'
,
'HannHist.pdf'
)
print
(
'-dpng'
,
'HannHist.png'
)
close
(
3
)
This diff is collapsed.
Click to expand it.
fullspectBoth.m
+
6
−
5
View file @
4750d36b
...
...
@@ -5,7 +5,7 @@ hold off
runlist
=
[
'S6'
];
run
=
[
'S6'
];
%windowlist = ['Hann ';'Tukey'];
windowlist
=
'
Tukey
'
;
windowlist
=
'
Hann
'
;
%ifolist = ['H1'; 'L1'];
ifolist
=
[
'H1'
];
...
...
@@ -54,10 +54,10 @@ irun = 1;
color
=
strtrim
(
plotcolor
(
iifo
,:));
fnameroot
=
sprintf
(
'%s%s'
,
run
,
ifo
);
fname1
=
sprintf
(
'%s_%s_40_2000test.txt'
,
fnameroot
,
strtrim
(
windowlist
(
irun
,:)));
fnameFull1
=
strcat
(
'~gmeadors/2012/1
0
/2
4
/AMPS/'
,
fname1
);
fnameFull1
=
strcat
(
'~gmeadors/2012/1
1
/2
1
/AMPS/'
,
fname1
);
data1
=
load
(
fnameFull1
);
fname2
=
sprintf
(
'%s_%s_40_2000feedforward.txt'
,
fnameroot
,
strtrim
(
windowlist
(
irun
,:)));
fnameFull2
=
strcat
(
'~gmeadors/2012/1
0
/2
4
/AMPS/'
,
fname2
);
fnameFull2
=
strcat
(
'~gmeadors/2012/1
1
/2
1
/AMPS/'
,
fname2
);
data2
=
load
(
fnameFull2
);
% Try resampling to smooth random variation.
% This combines neighboring bins.
...
...
@@ -69,11 +69,12 @@ irun = 1;
resampleFilterSize
=
225
;
% Theoretically, the frequency array is linear so it could be resampled
% using a less sophisticated algorithm. Yet why not try out resample here?
% Multiply by sqrt(8/3) for the Hann window normalization
freq
{
irun
,
iifo
}
=
resample
(
data1
(:,
1
),
1
,
...
resampleFactor
,
resampleFilterSize
);
amppsd
{
irun
,
iifo
}
=
resample
(
data1
(:,
5
),
1
,
...
amppsd
{
irun
,
iifo
}
=
sqrt
(
8
/
3
)
*
resample
(
data1
(:,
5
),
1
,
...
resampleFactor
,
resampleFilterSize
);
amppsdwt
{
irun
,
iifo
}
=
resample
(
data2
(:,
5
),
1
,
...
amppsdwt
{
irun
,
iifo
}
=
sqrt
(
8
/
3
)
*
resample
(
data2
(:,
5
),
1
,
...
resampleFactor
,
resampleFilterSize
);
sprintf
(
'Looping over single-IFO bands...'
)
for
iband
=
1
:
length
(
bandlolist
)
...
...
This diff is collapsed.
Click to expand it.
fullspectDiff.m
+
7
−
6
View file @
4750d36b
...
...
@@ -5,7 +5,7 @@ hold off
runlist
=
[
'S6'
];
run
=
[
'S6'
];
%windowlist = ['Hann ';'Tukey'];
windowlist
=
'
Tukey
'
;
windowlist
=
'
Hann
'
;
%ifolist = ['H1'; 'L1'];
ifolist
=
[
'H1'
];
...
...
@@ -54,10 +54,10 @@ irun = 1;
color
=
strtrim
(
plotcolor
(
iifo
,:));
fnameroot
=
sprintf
(
'%s%s'
,
run
,
ifo
);
fname1
=
sprintf
(
'%s_%s_40_2000test.txt'
,
fnameroot
,
strtrim
(
windowlist
(
irun
,:)));
fnameFull1
=
strcat
(
'~gmeadors/2012/
06
/2
9
/AMPS/'
,
fname1
);
fnameFull1
=
strcat
(
'~gmeadors/2012/
11
/2
1
/AMPS/'
,
fname1
);
data1
=
load
(
fnameFull1
);
fname2
=
sprintf
(
'%s_%s_40_2000feedforward.txt'
,
fnameroot
,
strtrim
(
windowlist
(
irun
,:)));
fnameFull2
=
strcat
(
'~gmeadors/2012/
06
/2
9
/AMPS/'
,
fname2
);
fnameFull2
=
strcat
(
'~gmeadors/2012/
11
/2
1
/AMPS/'
,
fname2
);
data2
=
load
(
fnameFull2
);
% Try resampling to smooth random variation.
% This combines neighboring bins.
...
...
@@ -69,11 +69,12 @@ irun = 1;
resampleFilterSize
=
900
;
% Theoretically, the frequency array is linear so it could be resampled
% using a less sophisticated algorithm. Yet why not try out resample here?
% Because we are using Hann windows, multiply by sqrt(8/3)
freq
{
irun
,
iifo
}
=
resample
(
data1
(:,
1
),
1
,
...
resampleFactor
,
resampleFilterSize
);
amppsd
{
irun
,
iifo
}
=
resample
(
data1
(:,
3
)
-
data2
(:,
3
),
1
,
...
amppsd
{
irun
,
iifo
}
=
sqrt
(
8
/
3
)
*
resample
(
data1
(:,
3
)
-
data2
(:,
3
),
1
,
...
resampleFactor
,
resampleFilterSize
);
amppsdwt
{
irun
,
iifo
}
=
resample
(
data1
(:,
5
)
-
data2
(:,
5
),
1
,
...
amppsdwt
{
irun
,
iifo
}
=
sqrt
(
8
/
3
)
*
resample
(
data1
(:,
5
)
-
data2
(:,
5
),
1
,
...
resampleFactor
,
resampleFilterSize
);
sprintf
(
'Looping over single-IFO bands...'
)
for
iband
=
1
:
length
(
bandlolist
)
...
...
@@ -99,7 +100,7 @@ irun = 1;
%plot(freqdesign,sensdesign,'color','blue');
grid
legend
(
'Average amplitude PSD'
,
'Weighted average amplitude PSD'
,
'Location'
,
'North'
)
titlestr
=
sprintf
(
'%s %s Average Spectra (%d-%d Hz)'
,
run
,
ifo
,
round
(
bandlo
),
round
(
bandhi
));
titlestr
=
sprintf
(
'%s %s Average Spectra
, Before - After
(%d-%d Hz)'
,
run
,
ifo
,
round
(
bandlo
),
round
(
bandhi
));
title
(
titlestr
)
fnamepdf
=
sprintf
(
'%s_%s.pdf'
,
fnameroot
,
bandname
)
print
(
'-dpdf'
,
fnamepdf
)
...
...
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