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

Vectorscope Logic FIx #47

Open
3 of 4 tasks
KinMaynard opened this issue Oct 7, 2021 · 9 comments
Open
3 of 4 tasks

Vectorscope Logic FIx #47

KinMaynard opened this issue Oct 7, 2021 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@KinMaynard
Copy link
Owner

KinMaynard commented Oct 7, 2021

Logic

  • better way to handle mono signals than doubling them up?
    halve the amplitudes in each array column so it's the same as it was before?
  • logic for lissajous solo or subplot axes initializing
  • plot polar data with correct transform
  • change polar scatter plot to plot() (faster?)

Originally posted by @KinMaynard in #37 (comment)

@KinMaynard KinMaynard self-assigned this Oct 7, 2021
@KinMaynard KinMaynard added the bug Something isn't working label Oct 7, 2021
@KinMaynard
Copy link
Owner Author

Try midside again and try putting negative values from left into right and vice versa.

@KinMaynard
Copy link
Owner Author

KinMaynard commented Oct 8, 2021

So it's actually not that simple theoretically. I think the steps are like this:

  • Split array into left and right
  • make new array from all positive floats in right array
  • remove positive floats from right array
  • take absolute value of left and right arrays
  • make array of positive right values negative
  • put negative right array back into right array

When removing positive floats from the right array I need to leave something in their place that I can replace later with the-

i think this is simpler than I'm making it. What am I trying to do? I want to take the absolute value of the left array. I want to also turn all positive floats in the right array negative and all negative floats in the right array positive.

So I want to take the absolute value of the left array.
and switch the sign of the values in the right array.

Okay I tried that and it doesn't look right. Need to try something else.

@KinMaynard
Copy link
Owner Author

KinMaynard commented Oct 8, 2021

Okay I need some new pictures to see what's happening with the data and to help come up with the correct transform for the polar plot. I want to also compare my lissajous output with signalizer. I also want to implement lissajous figures instead of dot per sample on the lissajous plot.

  • Take photos of lissajous output
  • take photos of vectorscope output
  • compare to signalizer

separate issue now:

  • lissajous figure transforms (lines)

@KinMaynard
Copy link
Owner Author

Just realized before I take these photos I need to auto limit the lissajous ax to the data max.

@KinMaynard
Copy link
Owner Author

KinMaynard commented Oct 8, 2021

silence:
silence
white noise:
white
chirp:
chirp
sin:
sin
Out of phase sin:
out
song:
song

2 things are clear from this:

  • The data is flipped along the y axis. It's on the wrong sides as visible in the 2 sin plots.
  • The axis limits need to be computed based on the data peak so the silence will show for example.

@KinMaynard
Copy link
Owner Author

KinMaynard commented Oct 9, 2021

So one possible theory for the polar transform is:

Absolute value of values that share a sign with their row counterpart
switch signs of values with opposite signs to their row counterpart

(possibly same result as midside encoding?) - Not the same result.

So for the former condition I want to use the where argument in np.absolute. I want to make a mask of all values that share a sign with their row-wise counterpart as true. I can use this same mask for the second condition by running np.negative's where argument on the False elements of the mask.

Tried this new transform and it doesn't look right.

Might shelve the polar vectorscope for now.

@KinMaynard KinMaynard added this to the 1.0 Release milestone Oct 9, 2021
@KinMaynard
Copy link
Owner Author

I believe I was trivializing phase in cases with complex waves. The sign of the amplitudes in an array of audio data only corresponds to phase in the case of a sin wave. Any complex wave can be transformed into a collection of signs and phase with an FFT of which the signs correspond to the phase. But for a complex waveform like most of my test data this is not the case. This means I want to perform a fast fourier transform on the data before trying to plot amplitudes and phase. I can either:

Try matplotlib's phase spectrum (as polar)
and angle spectrum plots (as polar)
or perform an FFT with numpy then plot as a polar plot with plot function or scatter

@KinMaynard
Copy link
Owner Author

So it seems like matplotlib's phase and angle spectrum plots are plotting something I don't understand. I thought they were taking an FFT of the input and plotting the phase and wrapped phase. The plots look different than I would expect and so I feel like I can't use them for this.

@KinMaynard
Copy link
Owner Author

I'm going to push fixing the polar vectorscope to a later release.

@KinMaynard KinMaynard modified the milestones: 1.0 Release, 2.0 Release Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant