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

Waterfall/Spectrum display seem to be different scale #30

Open
wose opened this issue Aug 20, 2021 · 1 comment
Open

Waterfall/Spectrum display seem to be different scale #30

wose opened this issue Aug 20, 2021 · 1 comment

Comments

@wose
Copy link
Owner

wose commented Aug 20, 2021

image
(Submitted by crazy_imp on irc)

@wose
Copy link
Owner Author

wose commented Aug 25, 2021

The waterfall widget does not interpolate between pixels, the spectrum widget does. This leads to an offset between the two displays depending on the available width for the waterfall widget:

// we do not interpolate between pixels so we just zoom slightly in and display
// the area.width pixel in the center of the waterfall
let start = (styles.len() - area.width as usize) / 2;
for (column, style) in styles
    .iter()
    .skip(start)
    .take(area.width as usize)
    .enumerate() {
        buf.set_string(
            area.left() + column as u16,
            area.top() + row as u16,
            PIX,
            *style,
        );
    }

We already try to scale the frequency down to almost the available width. We should stop doing this and instead scale to exactly the correct width and build the pixels using the max (since we don't want to loose narrow signals) between two scaled frequencies (columns).

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

No branches or pull requests

1 participant