6 return path1.get_weight() > path2.get_weight();
80 std::cout <<
"weight=" <<
weight <<
"\n";
99 double deltaf_thisscale = deltaf_refscale * refscale_to_thisscale;
102 pixel path_center = {
111 path_center.
time=path_center.
timeix/(2*deltaf_thisscale);
112 path_center.
freq=path_center.
freqix*deltaf_thisscale;
114 out.push_back(path_center);
119 for (
int n=1;
n<path_width; ++
n) {
120 pixel path_side=path_center;
122 path_side.
time=path_side.
timeix/(2*deltaf_thisscale);
123 out.push_back(path_side);
125 path_side=path_center;
127 path_side.
time=path_side.
timeix/(2*deltaf_thisscale);
128 out.push_back(path_side);
135 class is_coincident_with {
137 is_coincident_with(
double ref_time,
double precision): _ref_time(ref_time),_precision(precision){}
139 bool operator()(
cluster const &
x)
const {
140 return abs(_ref_time-(x.back()).
time) <= _precision;
157 std::vector<cluster> selected;
160 std::cout <<
"debug flag: select univocal clusters\n";
161 std::cout <<
"total number of clusters is " << sorted_clusters.size() <<
"\n";
164 while (! sorted_clusters.empty()) {
165 cluster first=sorted_clusters.front();
166 selected.push_back(first);
167 double ref_time=(first.back()).
time;
168 sorted_clusters.erase(std::remove_if(sorted_clusters.begin(),sorted_clusters.end(),is_coincident_with(ref_time,precision)),sorted_clusters.end());
170 std::cout <<
"remaining number of clusters is " << sorted_clusters.size() <<
"\n";
175 std::cout <<
"retained " << selected.size() <<
" univocal clusters\n";
std::vector< pixel > cluster
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
std::vector< cluster > select_clusters_distinct_in_time(std::vector< cluster > &sorted_clusters, const double precision)
void init(const wavenode node, const int offset, const int refscaleidx, const double path_weight)
bool compare_paths(const wavepath &path1, const wavepath &path2)
void add_node(const wavenode node)
cluster convert_to_cluster(const int scalemin, const double fs, const int path_width)