make zoomed in view show evenly-spaced samples #186
Conversation
|
Related discussion on Audacity forum: http://forum.audacityteam.org/viewtopic.php?f=28&t=94931 |
|
Love the idea, and I agree with Steve's point that we need sub-pixel resolution for the vertical lines. That shouldn't slow plotting noticeably, because we are drawing fewer lines than in a zoomed out view. May be able to use http://docs.wxwidgets.org/3.1.0/classwx_graphics_context.html for it. I also have fast code for sub pixel resolution based on antigrain library. The code here is proof of concept, so we will close this one shortly unless it is progressed as described by Steve. |
|
Sounds good Can you help me with what specifically this would need to land? Is it just a matter of enabling Anti-aliasing in WxWidgets? |
|
Hm, I don't think it's antialiasing I want. I tried turning it on and the lines get significantly blurrier. |
|
The stem plot reminds me of another option for depicting the wave at high
zoom levels that I thought I might try to implement some rainy day.
That is, to interpolate between samples, not with a piecewise linear curve,
but rather to compute the weighted sum of sinc functions. I understand
that shows the unique band-limited continuous function that fits the given
samples, and is the curve on which new samples will fall if you do a
high-quality resampling to a higher rate.
It's one of those interesting mostly math-y projects that wouldn't upset
large amounts of code.
PRL
…On Sun, Apr 9, 2017 at 6:43 PM, Brian Armstrong ***@***.***> wrote:
Hm, I don't think it's antialiasing I want. I tried turning it on and the
lines get significantly blurrier.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#186 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALITYWcVI3x7ImGpsqOkFlwCLb6k4vQHks5ruV8NgaJpZM4MWi4Y>
.
|
|
@Paul-Licameli Although it's true that you could represent the signal in multiple ways, I believe the one I have provided is considered to be canonical within DSP. For example, the following two pages appear in Richard Lyon's Understanding Digital Signal Processing On the second page, it explicitly says "Do not be tempted to draw lines between the dots in Figure 1-1(b). For some reason, people ... want to connect the dots with straight lines, or the stairstep lines shown in Figure 1-1(c). Don't fall into this innocent-looking trap." Or to use another example, we can look at some arbitrarily-chosen plots from Proakis and Manolakis's Digital Signal Processing It seems all of the plots in this book are rendered this way when they contain discrete-time signals. And as far as I know, this stem method is also commonly chosen for DSP plots generated by MATLAB. I think given the abundance of this particular plot, it would be handy to be able to render this way in Audacity as well, at least as an option :) After all, what is 44.1kHz audio if not discrete samples? |
|
Can you share a screenshot of the 'blurrier' lines? When anti-aliasing works well the lines ARE blurrier, and the overall effect (from screen distance) is better. Have a look at the ruler lines in the 'zoomable ruler' section of http://wiki.audacityteam.org/wiki/Proposal_TrackPanel_Evolution . Have a look up close, and then from normal distance. Those ruler lines are drawn with anti-aliasing in order to be able to draw them at any spacing. They look evenly spaced and of even width. |
+ change engagement for stem plot
|
@JamesCrook Ok, I've pushed an update with AA turned on. Your explanation makes sense, thanks! Here's a preview |
|
Unfortunately I'm getting a segmentation fault when zooming in. |
|
@SteveDaulton I'm guessing that wxGraphicsContext is not always available. I pushed a change that should skip setting AA if it isn't. |
|
I'd just quickly tested with pretty much the same: |
|
@SteveDaulton Ok, that makes sense. I'm not so familiar with wxWidgets. Just from what I can tell from some googling, it seems that AA won't be an option for OSes without a GraphicsContext then. If that's a blocker, that may require a fairly substantial amount of work unless @JamesCrook's antigrain code can be used here? |
|
I've started a thread to discus this on devel@ mailing list. |
|
Stem plots are in now, and may not always have even spacing, but that is OK. So I am closing this pull request, which had some work on even spacing too. |
|
Thank you all for helping to land this one, and for the thoughtful discussion. I'm really excited that this made it |
|
Brian, thank you for this contribution. We wish to credit your contribution in the About Audacity... dialog of the next version, if you have no objections. |
Hi,
I love Audacity. Awesome stuff👍
I have been using Audacity to debug my modem library. I was thinking how much I'd love to be able to inspect individual samples as a stem plot, so I took a whack at implementing it.
You'd probably want these changes behind some user preference toggle. I'm more than happy to make those changes, if you do think this would be something you'd want.
Here's a screenshot of what it looks like http://i.imgur.com/Dqe2ds5.png
I've had to change the zoom behavior a little. This looks weird when the horizontal spacing between samples varies, so this locks the zoom in to be a multiple of the project sample rate.
Cheers!