Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling the phase of signal in pure data

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.

like image 454
KTB Avatar asked Jul 21 '16 04:07

KTB


People also ask

What is the phase of the signal?

In electronic signaling, phase is a definition of the position of a point in time (instant) on a waveform cycle. A complete cycle is defined as 360 degrees of phase as shown in Illustration A below. Phase can also be an expression of relative displacement between or among waves having the same frequency .

What is Pure Data vanilla?

About Pure Data (aka "Pd" / "Pd Vanilla") Pure Data (or just "Pd") is an open source visual programming language for multimedia. Pure Data is developed by Miller Puckette since 1996 and you can find it on his official website along with the official documentation and other related resources.

What is Pure Data written in?

The official manual for Pd[[Pure Data]] a dataflow programming environment can be accessed by a web browser locally through the menue Help → HTML[[HTML|Hypertext Markup Language]]. It is written by Pd[[Pure Data]] a dataflow programming environment's author Miller-Puckette and in English.


2 Answers

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!

like image 189
taylor vann Avatar answered Oct 17 '22 04:10

taylor vann


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.

like image 35
gilbertohasnofb Avatar answered Oct 17 '22 06:10

gilbertohasnofb