[Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

epalaima
Hi, I was studying the code for resonr in order to get a better idea of how bandpass filters are designed, and ran into a couple coefficient defined in the csound header whose precise definition I could not find. 

Those are tpidsr, pidsr, mpidsr, and mtpdsr found on line 1493 of csoundCore.h

My guess is that these are some sort of value divided by the sample rate (perhaps variations on pi / sr), but I'd like to get a precise definition if possible. 

Can anyone tell me exactly what values these coefficients hold?

Thanks!
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

Steven Yi
These values get set in Engine/csound_orc_compile.c:686:

    csound->tpidsr = TWOPI_F / csound->esr;               /* now set
internal  */
    csound->mtpdsr = -(csound->tpidsr);                   /*    consts
        */
    csound->pidsr = PI_F / csound->esr;
    csound->mpidsr = -(csound->pidsr);
    csound->onedksmps = FL(1.0) / (MYFLT) csound->ksmps;
    csound->sicvt = FMAXLEN / csound->esr;
    csound->kicvt = FMAXLEN / csound->ekr;
    csound->onedsr = FL(1.0) / csound->esr;
    csound->onedkr = FL(1.0) / csound->ekr;
    csound->global_kcounter  = csound->kcounter;

and they're pretty much as you suspected:

tpidsr = two pi divided by sr
mtpdsr = minute two pi divided by sr

etc.



On Fri, Sep 8, 2017 at 3:29 PM, Emmett Palaima <[hidden email]> wrote:

> Hi, I was studying the code for resonr in order to get a better idea of how
> bandpass filters are designed, and ran into a couple coefficient defined in
> the csound header whose precise definition I could not find.
>
> Those are tpidsr, pidsr, mpidsr, and mtpdsr found on line 1493 of
> csoundCore.h
>
> My guess is that these are some sort of value divided by the sample rate
> (perhaps variations on pi / sr), but I'd like to get a precise definition if
> possible.
>
> Can anyone tell me exactly what values these coefficients hold?
>
> Thanks!
> Csound mailing list [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

jpff
In reply to this post by epalaima
tpidsr is TwoPiDividedbySr.

Others follow the same pattern
⁣Sent from TypeApp ​

On Sep 8, 2017, 20:30, at 20:30, Emmett Palaima <[hidden email]> wrote:

>Hi, I was studying the code for resonr in order to get a better idea of
>how
>bandpass filters are designed, and ran into a couple coefficient
>defined in
>the csound header whose precise definition I could not find.
>
>Those are tpidsr, pidsr, mpidsr, and mtpdsr found on line 1493 of
>csoundCore.h
><https://github.com/csound/csound/blob/495bb9cfd5bc4d19ce02a988fba3764b4141c850/include/csoundCore.h>
>
>My guess is that these are some sort of value divided by the sample
>rate
>(perhaps variations on pi / sr), but I'd like to get a precise
>definition
>if possible.
>
>Can anyone tell me exactly what values these coefficients hold?
>
>Thanks!
>
>Csound mailing list
>[hidden email]
>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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

epalaima
When you said minute did you mean to say minus? That seems to be what the code is doing. I think minute pi has a meaning in relation to radians however, so I'd just like to make sure. 

On Fri, Sep 8, 2017 at 3:36 PM, John ff <[hidden email]> wrote:
tpidsr is TwoPiDividedbySr.

Others follow the same pattern
⁣Sent from TypeApp ​

On Sep 8, 2017, 20:30, at 20:30, Emmett Palaima <[hidden email]> wrote:
>Hi, I was studying the code for resonr in order to get a better idea of
>how
>bandpass filters are designed, and ran into a couple coefficient
>defined in
>the csound header whose precise definition I could not find.
>
>Those are tpidsr, pidsr, mpidsr, and mtpdsr found on line 1493 of
>csoundCore.h
><https://github.com/csound/csound/blob/495bb9cfd5bc4d19ce02a988fba3764b4141c850/include/csoundCore.h>
>
>My guess is that these are some sort of value divided by the sample
>rate
>(perhaps variations on pi / sr), but I'd like to get a precise
>definition
>if possible.
>
>Can anyone tell me exactly what values these coefficients hold?
>
>Thanks!
>
>Csound mailing list
>[hidden email]
>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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] What are tpidsr, pidsr, mpidsr, and mtpdsr?

Steven Yi
Yes, that was a typo, and should have been "minus". :)

On Fri, Sep 8, 2017 at 8:36 PM, Emmett Palaima <[hidden email]> wrote:

> When you said minute did you mean to say minus? That seems to be what the
> code is doing. I think minute pi has a meaning in relation to radians
> however, so I'd just like to make sure.
>
> On Fri, Sep 8, 2017 at 3:36 PM, John ff <[hidden email]> wrote:
>>
>> tpidsr is TwoPiDividedbySr.
>>
>> Others follow the same pattern
>> ⁣Sent from TypeApp
>>
>> On Sep 8, 2017, 20:30, at 20:30, Emmett Palaima <[hidden email]>
>> wrote:
>> >Hi, I was studying the code for resonr in order to get a better idea of
>> >how
>> >bandpass filters are designed, and ran into a couple coefficient
>> >defined in
>> >the csound header whose precise definition I could not find.
>> >
>> >Those are tpidsr, pidsr, mpidsr, and mtpdsr found on line 1493 of
>> >csoundCore.h
>>
>> > ><https://github.com/csound/csound/blob/495bb9cfd5bc4d19ce02a988fba3764b4141c850/include/csoundCore.h>
>> >
>> >My guess is that these are some sort of value divided by the sample
>> >rate
>> >(perhaps variations on pi / sr), but I'd like to get a precise
>> >definition
>> >if possible.
>> >
>> >Can anyone tell me exactly what values these coefficients hold?
>> >
>> >Thanks!
>> >
>> >Csound mailing list
>> >[hidden email]
>> >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
>> [hidden email]
>> 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 [hidden email]
> 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
[hidden email]
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