#include <AdcChannelFFT.h>
Definition at line 74 of file AdcChannelFFT.h.
Definition at line 24 of file AdcChannelFFT_tool.cc.
31 const string myname =
"AdcChannelFFT::ctor: ";
33 cout << myname <<
"Configuration: " <<
endl;
ChannelGroupService::Name Name
static constexpr double ps
QTextStream & endl(QTextStream &s)
AdcChannelFFT::~AdcChannelFFT |
( |
| ) |
|
|
overridedefault |
Definition at line 151 of file AdcChannelFFT_tool.cc.
152 const string myname =
"AdcChannelFFT::internalView: ";
153 bool doForward =
false;
154 bool doInverse =
false;
158 doForward = acd.
dftmags.size() == 0;
166 doInverse = acd.
samples.size() == 0;
172 cout << myname <<
"ERROR: Invalid action: " <<
m_Action <<
endl;
183 if ( isam0 >= acd.
samples.size() ) {
184 cout << myname <<
"WARNING: No data in range." <<
endl;
188 nsam = acd.
samples.size() - isam0;
189 if (
m_LogLevel >= 3 ) cout << myname <<
"Forward FFT with " << nsam <<
" samples." <<
endl;
194 cout << myname <<
"WARNING: Forward FFT failed." <<
endl;
197 }
else if ( doInverse ) {
199 if ( ! dft.isValid() ) {
201 cout <<
"ERROR: Unable to find DFT in AdcChannelData." <<
endl;
207 if (
m_LogLevel >= 3 ) cout << myname <<
"Inverse FFT for " << dft.size() <<
" samples." <<
endl;
210 cout << myname <<
"WARNING: Inverse FFT failed." <<
endl;
219 for (
Index ifrq=0; ifrq<nsam; ++ifrq ) {
220 fftres[ifrq] = dft.real(ifrq);
221 fftims[ifrq] = dft.imag(ifrq);
227 if ( doForward ) dft.moveOut(xams, xphs);
230 ret.
setInt(
"fftTick0", isam0);
231 ret.
setInt(
"fftNTick", nsam);
234 ret.
setInt(
"fftNMag", xams.size());
235 ret.
setInt(
"fftNPhase", xphs.size());
DataMap & setStatus(int stat)
static AdcIndex dftNormalization()
static int fftForward(Index ntick, const float *psam, DFT &dft, Index logLevel=0)
void setInt(Name name, int val)
AdcSignalVector dftphases
static int fftInverse(const DFT &dft, FloatVector &sams, Index logLevel=0)
Dft::FloatVector FloatVector
void setFloatVector(Name name, const FloatVector &val)
QTextStream & endl(QTextStream &s)
Reimplemented from AdcChannelTool.
Definition at line 73 of file AdcChannelFFT_tool.cc.
74 const string myname =
"AdcChannelFFT::update: ";
79 cout << myname <<
"View " <<
m_DataView <<
" not found for event " << acd.
event()
87 for (
AdcIndex ient=0; ient<nent; ++ient ) {
90 if ( pacd ==
nullptr ) {
91 cout << myname <<
"Channel " << acd.
channel() <<
" view entry " 100 retTop.
setInt(
"fftNproc", nproc);
101 retTop.
setInt(
"fftNfail", nproc);
104 cout << myname <<
"Channel " << acd.
channel() <<
" entry counts: " 105 << nproc <<
" processed, " << nfail <<
" failed." <<
endl;
DataMap & setStatus(int stat)
void setInt(Name name, int val)
DataMap updateTop(AdcChannelData &acd) const
AdcChannelData * mutableViewEntry(Name vpnam, AdcIndex ient)
bool hasView(Name vnam) const
QTextStream & endl(QTextStream &s)
Definition at line 124 of file AdcChannelFFT_tool.cc.
125 const string myname =
"AdcChannelFFT::update: ";
131 if ( ret )
return ret;
141 if (
m_LogLevel >= 2 ) cout << myname <<
"Saving samples." <<
endl;
std::vector< float > FloatVector
AdcSignalVector dftphases
QTextStream & endl(QTextStream &s)
void internalView(const AdcChannelData &acd, FloatVector &sams, FloatVector &s, FloatVector &phas, DataMap &ret) const
Reimplemented from AdcChannelTool.
Definition at line 45 of file AdcChannelFFT_tool.cc.
46 const string myname =
"AdcChannelFFT::view: ";
51 cout << myname <<
"View " <<
m_DataView <<
" not found for event " << acd.
event()
59 for (
AdcIndex ivie=0; ivie<nvie; ++ivie ) {
65 retTop.
setInt(
"fftNproc", nproc);
66 retTop.
setInt(
"fftNfail", nproc);
DataMap & setStatus(int stat)
void setInt(Name name, int val)
DataMap viewTop(const AdcChannelData &acd) const
const AdcChannelData * viewEntry(Name vpnam, AdcIndex ient) const
bool hasView(Name vnam) const
QTextStream & endl(QTextStream &s)
Definition at line 112 of file AdcChannelFFT_tool.cc.
113 const string myname =
"AdcChannelFFT::view: ";
std::vector< float > FloatVector
void internalView(const AdcChannelData &acd, FloatVector &sams, FloatVector &s, FloatVector &phas, DataMap &ret) const
Index AdcChannelFFT::m_Action |
|
private |
Name AdcChannelFFT::m_DataView |
|
private |
Index AdcChannelFFT::m_FirstTick |
|
private |
int AdcChannelFFT::m_LogLevel |
|
private |
Index AdcChannelFFT::m_NTick |
|
private |
Index AdcChannelFFT::m_ReturnOpt |
|
private |
The documentation for this class was generated from the following files: