Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 06cd31a0ec19
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d6b0fd89ac89
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Aug 16, 2020

  1. FFT decode now has proper gain/offset internally. Not settable, but a…

    …llows better integration w/ glscopeclient UI.
    azonenberg committed Aug 16, 2020
    Copy the full SHA
    d6b0fd8 View commit details
Showing with 14 additions and 5 deletions.
  1. +6 −2 scopeprotocols/FFTDecoder.cpp
  2. +3 −0 scopeprotocols/FFTDecoder.h
  3. +5 −3 scopeprotocols/WaterfallDecoder.cpp
8 changes: 6 additions & 2 deletions scopeprotocols/FFTDecoder.cpp
Original file line number Diff line number Diff line change
@@ -51,6 +51,10 @@ FFTDecoder::FFTDecoder(string color)
m_rdin = NULL;
m_rdout = NULL;
m_plan = NULL;

//Default config
m_range = 70;
m_offset = 35;
}

FFTDecoder::~FFTDecoder()
@@ -78,12 +82,12 @@ bool FFTDecoder::ValidateChannel(size_t i, OscilloscopeChannel* channel)

double FFTDecoder::GetOffset()
{
return 0;
return m_offset;
}

double FFTDecoder::GetVoltageRange()
{
return 1;//m_channels[0]->GetVoltageRange();
return m_range;
}

string FFTDecoder::GetProtocolName()
3 changes: 3 additions & 0 deletions scopeprotocols/FFTDecoder.h
Original file line number Diff line number Diff line change
@@ -66,6 +66,9 @@ class FFTDecoder : public ProtocolDecoder
float* m_rdin;
float* m_rdout;
ffts_plan_t* m_plan;

float m_range;
float m_offset;
};

#endif
8 changes: 5 additions & 3 deletions scopeprotocols/WaterfallDecoder.cpp
Original file line number Diff line number Diff line change
@@ -62,6 +62,8 @@ WaterfallDecoder::WaterfallDecoder(string color)
, m_width(1)
, m_height(1)
{
m_xAxisUnit = Unit(Unit::UNIT_HZ);

//Set up channels
m_signalNames.push_back("din");
m_channels.push_back(NULL);
@@ -72,7 +74,7 @@ WaterfallDecoder::WaterfallDecoder(string color)

bool WaterfallDecoder::ValidateChannel(size_t i, OscilloscopeChannel* channel)
{
if( (i == 0) && (channel->GetYAxisUnits() != Unit::UNIT_DBM) )
if( (i == 0) && (channel->GetYAxisUnits() == Unit::UNIT_DBM) )
return true;
return false;
}
@@ -137,7 +139,7 @@ void WaterfallDecoder::Refresh()
}

//Initialize the capture
//TODO: timestamps? do we need those?qui
//TODO: timestamps? do we need those?
WaterfallWaveform* cap = dynamic_cast<WaterfallWaveform*>(m_data);
if(cap == NULL)
cap = new WaterfallWaveform(m_width, m_height);
@@ -164,7 +166,7 @@ void WaterfallDecoder::Refresh()

float value = 0;
if(nbin < inlen)
value = (-70 - 20 * log10(din->m_samples[nbin])) / -70;
value = 1 - ( (din->m_samples[nbin]) / -70 );

//Cap values to prevent going off-scale-low with our color ramps
if(value < vmin)