Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
72f9272d
Commit
72f9272d
authored
Sep 13, 2017
by
Bruce Allen
Browse files
Synchronize phases with LLO in making plot
Add some frequency and amplitude modulation to the plot
parent
29445664
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/antenna_lib.cpp
View file @
72f9272d
...
...
@@ -343,7 +343,7 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) {
double
amp
=
sqrt
(
X
*
X
+
Y
*
Y
);
double
ang
=
180.0
*
atan2
(
Y
,
X
)
/
M_PI
;
// pass outputs
out
->
amp
[
i
]
=
amp
;
out
->
phase
[
i
]
=
ang
;
...
...
src/common.h
View file @
72f9272d
#ifndef COMMON_H
#define COMMON_H
#define PERIODS
2
0
#define PERIODS
1
0
#endif // COMMON_H
src/pulsaranimationwidget.cpp
View file @
72f9272d
...
...
@@ -592,9 +592,11 @@ void PulsarAnimationWidget::updatePulseProfile()
// populate plot data object
for
(
int
x
=
0
;
x
<
360
*
PERIODS
;
++
x
)
{
m_plotData
.
m_dataLLO
[
x
]
=
out
.
amp
[
0
]
*
sin
((
x
+
out
.
phase
[
0
])
*
deg2rad
);
// + out.dt[0];
m_plotData
.
m_dataLHO
[
x
]
=
out
.
amp
[
1
]
*
sin
((
x
+
out
.
phase
[
1
])
*
deg2rad
);
// + out.dt[1];
m_plotData
.
m_dataVirgo
[
x
]
=
out
.
amp
[
2
]
*
sin
((
x
+
out
.
phase
[
2
])
*
deg2rad
);
// + out.dt[2];
double
t
=
x
/
(
PERIODS
*
360.0
);
double
freq
=
1.0
/
pow
(
1.1
-
t
,
0.375
);
m_plotData
.
m_dataLLO
[
x
]
=
out
.
amp
[
0
]
*
freq
*
freq
*
sin
(
freq
*
x
*
deg2rad
);
// + out.dt[0];
m_plotData
.
m_dataLHO
[
x
]
=
out
.
amp
[
1
]
*
freq
*
freq
*
sin
((
freq
*
x
+
out
.
phase
[
1
]
-
out
.
phase
[
0
])
*
deg2rad
);
// + out.dt[1];
m_plotData
.
m_dataVirgo
[
x
]
=
out
.
amp
[
2
]
*
freq
*
freq
*
sin
((
freq
*
x
+
out
.
phase
[
2
]
-
out
.
phase
[
0
])
*
deg2rad
);
// + out.dt[2];
}
m_plotData
.
m_ampLLO
=
out
.
amp
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment