35#ifndef PeakDetectionFilter_h
36#define PeakDetectionFilter_h
48 {
return (m_y <
rhs.m_y); }
63 const std::vector<Peak>& GetPeaks()
77 AssertTypeIsAnalogWaveform(
cap);
81 size_t nouts =
cap->size();
82 if( (max_peaks == 0) || (nouts < 2) )
87 cap->PrepareForCpuAccess();
89 std::vector<Peak> peaks;
95 int64_t search_rad = search_bins/2;
96 search_rad = std::max(search_rad, (
int64_t)1);
133 float alpha =
cap->m_samples[
i-1];
138 (
i *
cap->m_timescale) +
182 std::sort(peaks.rbegin(), peaks.rend(), std::less<Peak>());
184 for(
size_t i=0;
i<(
size_t)max_peaks &&
i<peaks.size();
i++)
187 m_peaks.push_back(peaks[
i]);
196 std::vector<Peak> m_peaks;
218 void FindPeaks(
T*
cap, vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue)
220 PeakDetector::FindPeaks(
Definition AcceleratorBuffer.h:204
Encapsulates a Vulkan compute pipeline and all necessary resources to use it.
Definition ComputePipeline.h:55
A parameter to a filter.
Definition FilterParameter.h:86
int64_t GetIntVal() const
Returns the value of the parameter interpreted as an integer.
Definition FilterParameter.h:119
float GetFloatVal() const
Returns the value of the parameter interpreted as a floating point number.
Definition FilterParameter.h:144
Abstract base class for all filter graph blocks which are not physical instrument channels.
Definition Filter.h:105
static float GetMinVoltage(SparseAnalogWaveform *s, UniformAnalogWaveform *u)
Gets the lowest voltage of a waveform.
Definition Filter.h:530
Category
Category the filter should be displayed under in the GUI.
Definition Filter.h:118
virtual Unit GetYAxisUnits(size_t stream)
Returns the Y axis unit for a specified stream.
Definition InstrumentChannel.h:140
A filter that does peak detection.
Definition PeakDetectionFilter.h:210
Definition PeakDetectionFilter.h:58
Definition PeakDetectionFilter.h:39
int64_t GetOffsetScaled(T *wfm, size_t i)
Returns the offset of a sample from the start of the waveform, in X axis units.
Definition Waveform.h:841