Commit 66dcfc4343e810344fba08771421ca2aeff64eb1
Committed by
David Gräff
1 parent
a181f02b
Fix spectrum display
The loop was controlled with a different variable than the previous loops.
Showing
1 changed file
with
1 additions
and
1 deletions
openhantek/src/dataanalyzer.cpp
| ... | ... | @@ -371,7 +371,7 @@ void DataAnalyzer::run() { |
| 371 | 371 | double offset = 60 - this->settings->scope.spectrumReference - 20 * log10(dftLength); |
| 372 | 372 | double offsetLimit = this->settings->scope.spectrumLimit - this->settings->scope.spectrumReference; |
| 373 | 373 | for(std::vector<double>::iterator spectrumIterator = channelData->samples.spectrum.sample.begin(); spectrumIterator != channelData->samples.spectrum.sample.end(); ++spectrumIterator) { |
| 374 | - double value = 20 * log10(fabs(channelData->samples.spectrum.sample[position])) + offset; | |
| 374 | + double value = 20 * log10(fabs(*spectrumIterator)) + offset; | |
| 375 | 375 | |
| 376 | 376 | // Check if this value has to be limited |
| 377 | 377 | if(offsetLimit > value) | ... | ... |