Skip to content

Commit 1d829cf

Browse files
committed
Updated scopehal with interpolation improvements to peak search and FFT position fix
1 parent 9c7e4d6 commit 1d829cf

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

lib

release-notes/CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ This is a running list of significant bug fixes and new features since the last
66

77
* Core: Changed rate limiting sleep in InstrumentThread loop from 10ms to 1ms to avoid bogging down high performance instruments like the ThunderScope
88
* Drivers: ThunderScope now overlaps socket IO and GPU processing of waveforms giving a significant increase in WFM/s rate
9-
* Filters: CDR PLL is now GPU accelerated for the common case (no gating, deep waveform) and runs about 7.5x faster (https://github.com/ngscopeclient/scopehal/issues/977)
9+
* Filters: Added GPU acceleration for several filters including CDR PLL (7.5x speedup), 100baseTX (2.5x speedup), eye pattern (25x speedup), histogram (12x speedup), TIE (5.3x speedup) and more (https://github.com/ngscopeclient/scopehal/issues/977).
1010
* Filters: CDR PLL now outputs the input signal sampled by the recovered clock in a second data stream.
11-
* Filters: 100baseTX Ethernet is now GPU accelerated for a subset of processing and runs about 2.5x faster than before
12-
* Filters: Eye pattern is now GPU accelerated for the common case (DDR clock on uniformly sampled input) and runs about 25x faster
13-
* Filters: Histogram filter is now GPU accelerated and runs about 12x faster
11+
* Filters: Peak detector for FFT etc now does quadratic interpolation for sub-sample peak fitting
1412
* Filters: Horizontal bathtub curve now works properly with MLT-3 / PAM-3 eyes as well as NRZ. No PAM-4 or higher support yet.
1513
* Filters: PcapNG export now has an additional mode selector for use with named pipes, allowing live streaming of PcapNG formatted data to WireShark
16-
* Filters: TIE measurement is now GPU accelerated and runs about 5.3x faster than before
1714
* GUI: enabled mouseover BER measurements on MLT-3 / PAM-3 eyes as well as NRZ. No PAM-4 or higher support yet.
1815

1916
## Breaking changes since v0.1.1
@@ -25,6 +22,7 @@ We try to maintain compatibility with older versions of ngscopeclient but occasi
2522
## Bugs fixed since v0.1.1
2623

2724
* Filters: PcapNG export did not handle named pipes correctly (no github ticket)
25+
* Filters: FFT waveforms were shifted one bin to the right of the correct position
2826
* Filters: Frequency and period measurement had a rounding error during integer-to-floating-point conversion causing half a cycle of the waveform to be dropped under some circumstances leading to an incorrect result, with worse error at low frequencies and short memory depths. This only affected the "summary" output not the trend plot.
2927
* GUI: Pressing middle mouse on the Y axis to autoscale would fail, setting the full scale range to zero volts, if the waveform was resident in GPU memory and the CPU-side copy of the buffer was stale
3028

src/ngscopeclient/WaveformArea.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,9 +1378,8 @@ void WaveformArea::RenderSpectrumPeaks(ImDrawList* list, shared_ptr<DisplayedCha
13781378
for(auto p : peaks)
13791379
{
13801380
//Draw the circle for the peak
1381-
auto x = (p.m_x * data->m_timescale) + data->m_triggerPhase;
13821381
list->AddCircle(
1383-
ImVec2(m_group->XAxisUnitsToXPosition(x), YAxisUnitsToYPosition(p.m_y)),
1382+
ImVec2(m_group->XAxisUnitsToXPosition(p.m_x), YAxisUnitsToYPosition(p.m_y)),
13841383
radius,
13851384
circleColor,
13861385
0,
@@ -1390,11 +1389,11 @@ void WaveformArea::RenderSpectrumPeaks(ImDrawList* list, shared_ptr<DisplayedCha
13901389
bool hit = false;
13911390
for(size_t i=0; i<channel->m_peakLabels.size(); i++)
13921391
{
1393-
if( llabs(channel->m_peakLabels[i].m_peakXpos - x) < neighborThresholdXUnits )
1392+
if( llabs(channel->m_peakLabels[i].m_peakXpos - p.m_x) < neighborThresholdXUnits )
13941393
{
13951394
//This peak is close enough we'll call it the same. Update the position.
13961395
hit = true;
1397-
channel->m_peakLabels[i].m_peakXpos = x;
1396+
channel->m_peakLabels[i].m_peakXpos = p.m_x;
13981397
channel->m_peakLabels[i].m_peakYpos = p.m_y;
13991398
channel->m_peakLabels[i].m_peakAlpha = 255;
14001399
channel->m_peakLabels[i].m_fwhm = p.m_fwhm;
@@ -1408,8 +1407,8 @@ void WaveformArea::RenderSpectrumPeaks(ImDrawList* list, shared_ptr<DisplayedCha
14081407
PeakLabel npeak;
14091408

14101409
//Initial X position is just left of the peak
1411-
npeak.m_labelXpos = x - m_group->PixelsToXAxisUnits(5 * ImGui::GetFontSize());
1412-
npeak.m_peakXpos = x;
1410+
npeak.m_labelXpos = p.m_x - m_group->PixelsToXAxisUnits(5 * ImGui::GetFontSize());
1411+
npeak.m_peakXpos = p.m_x;
14131412
npeak.m_peakYpos = p.m_y;
14141413
npeak.m_fwhm = p.m_fwhm;
14151414

src/ngscopeclient/WaveformArea.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -149,6 +149,8 @@ struct ConfigPushConstants
149149
@brief State for a single peak label
150150
151151
All positions/sizes are in waveform units, not screen units, so that they scale/move correctly with the waveform
152+
153+
X axis positions are in base units, not scaled by timebase
152154
*/
153155
struct PeakLabel
154156
{

0 commit comments

Comments
 (0)