24 return path1.get_weight() > path2.get_weight();
98 std::cout <<
"weight=" <<
weight <<
"\n";
117 double deltaf_thisscale = deltaf_refscale * refscale_to_thisscale;
120 pixel path_center = {
129 path_center.
time=path_center.
timeix/(2*deltaf_thisscale);
130 path_center.
freq=path_center.
freqix*deltaf_thisscale;
132 out.push_back(path_center);
137 for (
int n=1;
n<path_width; ++
n) {
138 pixel path_side=path_center;
140 path_side.
time=path_side.
timeix/(2*deltaf_thisscale);
141 out.push_back(path_side);
143 path_side=path_center;
145 path_side.
time=path_side.
timeix/(2*deltaf_thisscale);
146 out.push_back(path_side);
153 class is_coincident_with {
155 is_coincident_with(
double ref_time,
double precision): _ref_time(ref_time),_precision(precision){}
157 bool operator()(
cluster const &
x)
const {
158 return abs(_ref_time-(x.back()).
time) <= _precision;
175 std::vector<cluster> selected;
178 std::cout <<
"debug flag: select univocal clusters\n";
179 std::cout <<
"total number of clusters is " << sorted_clusters.size() <<
"\n";
182 while (! sorted_clusters.empty()) {
183 cluster first=sorted_clusters.front();
184 selected.push_back(first);
185 double ref_time=(first.back()).
time;
186 sorted_clusters.erase(std::remove_if(sorted_clusters.begin(),sorted_clusters.end(),is_coincident_with(ref_time,precision)),sorted_clusters.end());
188 std::cout <<
"remaining number of clusters is " << sorted_clusters.size() <<
"\n";
193 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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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)