+ double samplerate = 0.0;
+
+ for (const shared_ptr<pv::data::SignalData> d : get_data()) {
+ assert(d);
+ const vector< shared_ptr<pv::data::Segment> > segments =
+ d->segments();
+ for (const shared_ptr<pv::data::Segment> &s : segments)
+ samplerate = std::max(samplerate, s->samplerate());
+ }
+
+ // If there is no sample rate given we use samples as unit
+ if (samplerate == 0.0)
+ samplerate = 1.0;
+
+ return samplerate;