Controlling the phase of signal in pure data
Asked Answered
F

2

6

I'm in need of figure out a way of changing the phase of a signal. Objective is to generate two signals with one phase changed and observe the patters when combined.

below is the program I'm using so far: enter image description here

As in the above setting, I need to use the same signal to generate a phase changed signal and later combine the two signals and observe patters.

Can someone help me out on this?

Thanks.

Faria answered 21/7, 2016 at 4:40 Comment(2)
I'm voting to close this question as off-topic because it seems related to electric engineering/signal processing instead of programming.Ammann
@NicolasMiari Oh please... The OP is not asking what is phase of a signal, but how a programming language (Pd) handles it.Outdoors
W
5

Using the right inlet of the [osc~] object is a valid way to set the phase of an oscillator but it isn't the only or even the most correct way. The right inlet only permits a float at the control level.

A more comprehensive manipulation of phase can be done at the signal level using the [phasor~], [cos~], [wrap~], and [+~] objects. Essentially, you are performing the same function as [osc~] with a technique called a table lookup using [phasor~] and [cos~]. You could read another table with [tabread4~] instead of [cos~] as well.

This technique keeps your oscillators in sync. You can manipulate the phase of your oscillators with other oscillators, table lookups, and still of course floats (so long as the phase value is between 0 and 1, hence the [wrap~] object).

phase modulation at the signal level

Afterwards, like the other examples here, you can add the signals together and write them to corresponding tables or output the signal chain or both.

Here's how you might do the same for a custom table lookup. Of course, you'd replace sometable with your custom table name and num-samp-in-some-table with the number of samples in your table.

signal level phase modulation with custom tables

Hope it helps!

Whipsaw answered 13/1, 2017 at 23:22 Comment(0)
O
5

To change the phase of an oscillator, use the right-hand side inlet.

Quoting Johannes Kreidler's Programming Electronic Music in Pd:

3.1.2.1.3 Phase

In Pd, you can also set membrane position for a sound wave where it should begin (or where it should jump to). This is called the phase of a wave. You can set the phase in Pd in the right inlet of the "osc~" object with numbers between 0 and 1:

enter image description here

A wave's entire period is encompassed by the range from 0 to 1. However, it is often spoken of in terms of degrees, where the entire period has 360 degrees. One speaks, for example, of a "90 degree phase shift". In Pd, the input for the phase would be 0.25.

So for instance, if you want to observe how two signals can become mute due to destructive interference, you can try something like this:

destructive-interference

Note that I connected a bang to adjust simultaneously the phases of both signals. This is important, because while you can reset the phase of a signal to any value between 0.0 and 1.0 at any moment, the other oscillator won't be reset and therefore the results will be quite random (you never know at which phase value the other signal will be at!). So resetting both does the trick.

Outdoors answered 21/7, 2016 at 20:52 Comment(1)
Thank you @gilberto, this is exactly my requirement.Faria
W
5

Using the right inlet of the [osc~] object is a valid way to set the phase of an oscillator but it isn't the only or even the most correct way. The right inlet only permits a float at the control level.

A more comprehensive manipulation of phase can be done at the signal level using the [phasor~], [cos~], [wrap~], and [+~] objects. Essentially, you are performing the same function as [osc~] with a technique called a table lookup using [phasor~] and [cos~]. You could read another table with [tabread4~] instead of [cos~] as well.

This technique keeps your oscillators in sync. You can manipulate the phase of your oscillators with other oscillators, table lookups, and still of course floats (so long as the phase value is between 0 and 1, hence the [wrap~] object).

phase modulation at the signal level

Afterwards, like the other examples here, you can add the signals together and write them to corresponding tables or output the signal chain or both.

Here's how you might do the same for a custom table lookup. Of course, you'd replace sometable with your custom table name and num-samp-in-some-table with the number of samples in your table.

signal level phase modulation with custom tables

Hope it helps!

Whipsaw answered 13/1, 2017 at 23:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.