-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a time resolution slider #127
base: main
Are you sure you want to change the base?
Conversation
plotview.cpp
Outdated
@@ -382,20 +382,27 @@ void PlotView::setFFTAndZoom(int size, int zoom) | |||
|
|||
void PlotView::setPowerMin(int power) | |||
{ | |||
powerMin = power; | |||
// HVI_REVIEW: Not needed? powerMin = power; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like these are unused and should be removed. I'd prefer that as a separate commit that just deletes the lines, rather than commenting them out
plotview.cpp
Outdated
{ | ||
if (spectrogramPlot != nullptr) | ||
spectrogramPlot->setTimeResolution(resolution); | ||
// updateView(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be commented out, it should just be deleted
spectrogramcontrols.cpp
Outdated
timeResolutionSlider = new QSlider(Qt::Horizontal, widget); | ||
timeResolutionSlider->setRange(0, 99); | ||
layout->addRow(new QLabel(tr("Time resolution:")), timeResolutionSlider); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, but I'd prefer this to be just under the zoom slider - it makes sense to group FFT size/zoom/resolution together.
spectrogramplot.cpp
Outdated
int windowSize = fftSize - zeroCount; | ||
for (int i = 0; i < windowSize; i++) { | ||
float term = float(2*i - windowSize + 1) / windowSize; | ||
window[i] = bessel(beta * sqrt(1.0 - term * term)) / denominator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I notice that the spectrogram shifts to the right as you increase the time resolution slider. To stop that happening, I think that the non-zero values should be centered in the window, rather than left-aligned.
This is looking like a nice feature, thanks for submitting and let me know what you think about the proposed changes. |
I will be making the changes you requested. |
I've been doing my own improvements in the meantime: I now use the liquid-dsp implementation of the kaiser window, and I made the beta parameter configurable as it is also handy to be able to tune the fft window shape. |
Hey miek, |
ping |
Increasing time resolution by narrowing the fft window function. The window function now is a Kaiser bessel function.
Also, I removed some variables that were not used.. They are just commented out, so please review this and if there is a reason for this, please let me know.