Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
d5648854
Commit
d5648854
authored
Jan 14, 2019
by
thomas.forbriger
Browse files
libpsdxx [WP]: provide template for taper class
parent
91b648f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/libpsdxx/helper.h
View file @
d5648854
...
...
@@ -116,6 +116,32 @@ namespace psd {
double
Mlnc
;
};
// class LogIndex
/* ---------------------------------------------------------------------- */
/*! \brief Taper function class
*/
class
Taper
{
private:
/*! Indicate location of center of taper
*/
enum
Eedge
{
Fmiddle
=
(
1
<<
0
),
//!< between smallest and largest frequency index
Fupper_end
=
(
1
<<
1
),
//!< smallest frequency index
Flower_end
=
(
1
<<
2
),
//!< largest frequency index
};
// enum Eedge
public:
Taper
(
const
psd
::
TDseries
::
Tcoc
&
f
,
const
unsigned
int
&
i
);
~
Taper
();
double
operator
()(
const
double
&
f
);
double
sum
()
const
{
return
(
Msum
);
}
private:
double
Msum
;
LogIndex
*
Mli
;
Eedge
Mloc
;
};
// class Taper
}
// namespace helper
}
// namespace psd
...
...
src/libs/libpsdxx/log_taper.cc
View file @
d5648854
...
...
@@ -34,11 +34,52 @@
"PSDXX_LOG_TAPER_CC V1.0"
#include
<psdxx/helper.h>
#include
<psdxx/error.h>
namespace
psd
{
namespace
helper
{
Taper
::
Taper
(
const
psd
::
TDseries
::
Tcoc
&
f
,
const
unsigned
int
&
i
)
:
Msum
(
0
)
{
PSDXX_assert
(
f
.
size
()
>
2
,
"at least three values of frequency are required"
);
if
(
i
==
0
)
{
this
->
Mloc
=
Flower_end
;
this
->
Mli
=
new
psd
::
helper
::
LogIndex
(
f
(
f
.
f
()),
f
(
f
.
f
()
+
1
),
f
(
f
.
f
()
+
2
));
}
else
if
(
i
==
(
f
.
size
()
-
1
))
{
this
->
Mloc
=
Fupper_end
;
this
->
Mli
=
new
psd
::
helper
::
LogIndex
(
f
(
f
.
l
()
-
2
),
f
(
f
.
l
()
-
1
),
f
(
f
.
l
()));
}
else
{
this
->
Mloc
=
Fmiddle
;
this
->
Mli
=
new
psd
::
helper
::
LogIndex
(
f
(
f
.
f
()
+
i
-
1
),
f
(
f
.
f
()
+
i
),
f
(
f
.
f
()
+
i
+
1
));
}
}
// Taper::Taper(const psd::TDseries::Tcoc& f,
// const unsigned int& i)
/* ---------------------------------------------------------------------- */
Taper
::~
Taper
()
{
delete
Mli
;
}
// Taper::~Taper()
/* ---------------------------------------------------------------------- */
double
Taper
::
operator
()(
const
double
&
f
)
{
double
retval
=
0
;
this
->
Msum
+=
retval
;
return
(
retval
);
}
// double Taper::operator()(const double& f) const
}
// namespace helper
}
// namespace psd
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment