Csound Csound-dev Csound-tekno Search About

[Csnd] Phasor manual entry note explanation

Date2019-12-29 21:18
FromTobiah
Subject[Csnd] Phasor manual entry note explanation
"Note that phasor is a special kind of integrator, accumulating phase 
increments that represent frequency settings".

Could someone explain this to the math impaired?


Thanks.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-12-29 21:42
FromVictor Lazzarini
SubjectRe: [Csnd] Phasor manual entry note explanation
The phase ph is integrated as follows

ph(t) = ph(t-1) + f/sr

to which a mod1() is applied to keep it
within 0-1 range. The frequency is f and
the sampling rate sr.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 29 Dec 2019, at 21:19, Tobiah  wrote:
> 
> "Note that phasor is a special kind of integrator, accumulating phase increments that represent frequency settings".
> 
> Could someone explain this to the math impaired?
> 
> 
> Thanks.
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-12-29 23:34
FromTobiah
SubjectRe: [Csnd] Phasor manual entry note explanation
 > "Note that phasor is a special kind of integrator, accumulating phase 
 > increments that represent frequency settings".

 >> Could someone explain this to the math impaired?

On 12/29/2019 1:42 PM, Victor Lazzarini wrote:
> The phase ph is integrated as follows
> 
> ph(t) = ph(t-1) + f/sr
> 
> to which a mod1() is applied to keep it
> within 0-1 range. The frequency is f and
> the sampling rate sr.

If that's how you explain this to the 'math impaired'
then your explanation to a graduate of mathematics must
be something to behold :)


I actually understand the equation, and the mod1() bit,
and this would be my expectation as to how the opcode works.
Never having taken Calculus, the bit about integration
threw me off.  I still don't really know what that means,
but it doesn't seem to be important to the understanding
of the opcode's operation.


Tobiah

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-12-30 01:16
FromVictor Lazzarini
SubjectRe: [Csnd] Phasor manual entry note explanation
Well, not sure what math impaired meant, but I guess I should have said a couple more things.

First, that integrator here means that you are constantly accumulating a value, basically summing up all previous values of the phase to get the current ("now") value. That's the + in the equation right hand side.

Secondly, sum what? Well if you think of the "instantaneous" frequency as the difference between two phase values (now and just before now), then that is what you need to add to get the next phase. The f/sr is this difference (sr is there because the difference is over 1 sampling period).

This way you can vary the frequency on a sample-by-sample basis and produce the correct phase signal.

This where calculus gets into it: from phases to frequencies you differentiate (get the differences between successive values). From frequency to phases, you integrate (keep accumulating them, summing).

It's actually simpler conceptually here because it's time discrete (as it is digital audio) and you don't need to worry about the complexities of continuous time. 

HTH

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 29 Dec 2019, at 23:34, Tobiah  wrote:
> 
> > "Note that phasor is a special kind of integrator, accumulating phase > increments that represent frequency settings".
> 
> >> Could someone explain this to the math impaired?
> 
>> On 12/29/2019 1:42 PM, Victor Lazzarini wrote:
>> The phase ph is integrated as follows
>> ph(t) = ph(t-1) + f/sr
>> to which a mod1() is applied to keep it
>> within 0-1 range. The frequency is f and
>> the sampling rate sr.
> 
> If that's how you explain this to the 'math impaired'
> then your explanation to a graduate of mathematics must
> be something to behold :)
> 
> 
> I actually understand the equation, and the mod1() bit,
> and this would be my expectation as to how the opcode works.
> Never having taken Calculus, the bit about integration
> threw me off.  I still don't really know what that means,
> but it doesn't seem to be important to the understanding
> of the opcode's operation.
> 
> 
> Tobiah
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-12-30 08:55
Fromjoachim heintz
SubjectRe: [Csnd] Phasor manual entry note explanation
thanks, very interesting.  i assume the sentence in the manual is from 
barry vercoe and was the ordinary way to express what happens for him ...



On 30/12/2019 02:16, Victor Lazzarini wrote:
> Well, not sure what math impaired meant, but I guess I should have said a couple more things.
> 
> First, that integrator here means that you are constantly accumulating a value, basically summing up all previous values of the phase to get the current ("now") value. That's the + in the equation right hand side.
> 
> Secondly, sum what? Well if you think of the "instantaneous" frequency as the difference between two phase values (now and just before now), then that is what you need to add to get the next phase. The f/sr is this difference (sr is there because the difference is over 1 sampling period).
> 
> This way you can vary the frequency on a sample-by-sample basis and produce the correct phase signal.
> 
> This where calculus gets into it: from phases to frequencies you differentiate (get the differences between successive values). From frequency to phases, you integrate (keep accumulating them, summing).
> 
> It's actually simpler conceptually here because it's time discrete (as it is digital audio) and you don't need to worry about the complexities of continuous time.
> 
> HTH
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 29 Dec 2019, at 23:34, Tobiah  wrote:
>>
>>> "Note that phasor is a special kind of integrator, accumulating phase > increments that represent frequency settings".
>>
>>>> Could someone explain this to the math impaired?
>>
>>> On 12/29/2019 1:42 PM, Victor Lazzarini wrote:
>>> The phase ph is integrated as follows
>>> ph(t) = ph(t-1) + f/sr
>>> to which a mod1() is applied to keep it
>>> within 0-1 range. The frequency is f and
>>> the sampling rate sr.
>>
>> If that's how you explain this to the 'math impaired'
>> then your explanation to a graduate of mathematics must
>> be something to behold :)
>>
>>
>> I actually understand the equation, and the mod1() bit,
>> and this would be my expectation as to how the opcode works.
>> Never having taken Calculus, the bit about integration
>> threw me off.  I still don't really know what that means,
>> but it doesn't seem to be important to the understanding
>> of the opcode's operation.
>>
>>
>> Tobiah
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here