Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Added a time resolution slider #127

wants to merge 4 commits into from

Conversation

hansvi
Copy link

@hansvi hansvi commented Apr 13, 2017

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.

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;
Copy link
Owner

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);
Copy link
Owner

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

timeResolutionSlider = new QSlider(Qt::Horizontal, widget);
timeResolutionSlider->setRange(0, 99);
layout->addRow(new QLabel(tr("Time resolution:")), timeResolutionSlider);

Copy link
Owner

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.

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;
Copy link
Owner

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.

@miek
Copy link
Owner

miek commented Apr 14, 2017

This is looking like a nice feature, thanks for submitting and let me know what you think about the proposed changes.

@hansvi
Copy link
Author

hansvi commented Apr 15, 2017

I will be making the changes you requested.

@hansvi
Copy link
Author

hansvi commented Apr 15, 2017

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.

@hansvi
Copy link
Author

hansvi commented Jun 4, 2017

Hey miek,
Can you take another look at the changes? I think the changes should be done.

Base automatically changed from master to main March 1, 2021 15:37
@catkira
Copy link
Contributor

catkira commented Oct 18, 2022

ping
is this repo still active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants