Phasor phase issue (iPad) - solved

Update: turns out I wrongly assumed it phased at the lowest point, turns out phase is at 0.

I couldn’t find any posts about this, so I wonder if it is me doing something wrong here or not.

I am trying to make a LFO that combines several LFO’s to make a single complex LFO. All was going great until I wanted to implement phase shifting between two phasors.

What I noticed is that it works great if both LFO’s have the same frequency, however once I changed one of the LFO’s frequencies I got some unexpected behaviour.

So I made a slimmed down setup with two sinus phasors and a sync button. With both phasors at the same frequency the sync button does what you expect and the waveforms stack on top of each other. Double the rate of one of the phasors however and they go out of phase and stay that way even after resyncing.

That to me makes no sense as a double rate phasor should stay in sync, it just makes twice as many waves.

I made a video on my Instagram displaying the issue:

https://www.instagram.com/p/BtbX7-1Ir-L/?utm_source=ig_share_sheet&igshid=1r3ket7jlt1s5

I hope someone can explain what is going on =)

What is the expected behavior?

I am seeing exactly a 2:1 ratio of frequencies.

Even if you use one phasor and scale the frequency inside the sine function you will see the same result.

I like all the stuff you are posting on instagram, by the way. Looks really fun!

edit: Maybe you are looking for some peaks to match up? You can adjust the phase by 90 degrees using a cosine for one of the frequencies.

1 Like

I’m wondering if there’s some squirrely graphics thing going on for you involving the the two waveform nodes. To rule that out, you might combine the two signals into one and run a single waveform of the resulting signal.

1 Like

I’m guessing, but I have a hunch that if push comes to shove, displayed waveform fidelity takes a backseat to signal fidelity.

1 Like

I think it’s in phase in the video.

The waveforms are in phase at the zero crossings

50%20AM

I think this is just a case of subjective assessment of what being “in phase” means. The math is correct though.

2 Likes

Yeah the waveforms aren’t in phase, but there’s also nothing wrong with what’s going on in the video. @dcLargo @ThaTyger what are you expecting it to look like? Perhaps what you have in your head is a phase shifted version of what you’re seeing here, like maybe 90 degrees or something?

Looks pretty clear, blown up like that. In my defense I’ll add that I’m stuck with my phone only right now.:wink:

2 Likes

up late on the iPhone? Well I never! (well, hardly ever).

1 Like

Never went to bed! On a night shift!

Well at least I found the error in my way. I expected it to be in phase at the low point like this:

So to achieve that I’d have to make like a 1/3 pi off set or something.

At least good to know that the error was mine =)

1 Like

Check out my previous post for using cosine to keep phase at the bottom.

https://discourse.audulus.com/t/phasor-phase-issue-ipad/1656/2?u=robertsyrett

The general solution is to make an offset in the expression sin(frequency*phasor + phase) where phase is also 0-2π.

Below is an examples of how to manually set the phase any way you please.


sine and phase.audulus (3.8 KB)

1 Like

Yeah I got the math, just made an incorrect assumption it seems. Will check that tread out.

I am working on this (most likely very inefficient) contraption that allows the user to pick from 4 phase states (0 / 90 / 180 / 270) and that is where I ran into the issue. But I should be able to fix it now that I know where I made the mistake =)

2 Likes

You doing that for your LFO module? Very cool!

That’s the plan =) Although I am not quite sure how to sync everything up, might have to do some trickery there. Interested to see if it will work and more importantly: if it does something useful =)

1 Like

You can just have simultaneous outputs of those phase relationships from one phasor and switch between those - that way it will always be in sync.

Have you seen the new Octature Sine LFO in the library reface? It allows you to continuously spread 8 LFOs apart with one control. It’s in the library reface post.

Actually not a bad idea. Was thinking about that as an efficiency update anyways. For symplicity sake I’ve just duplicated the one LFO 4 times. So that is less efficient anyways. Some reworking to do. Haven’t honestly looked into libraries and stuff will do =)