Csound Csound-dev Csound-tekno Search About

[Csnd] pvsftr with AMP_PHASE

Date2025-02-19 15:00
FromRichard Knight
Subject[Csnd] pvsftr with AMP_PHASE
I was curious to see if pvsftw and pvsftr worked with AMP_PHASE analysis 
from pvsifd.

pvsftw seems to work without complaining, but then pvsftr fails with 
"pvsftr: signal format must be amp-phase or amp-freq." - which in a way 
is promising as it is saying that it does support AMP_PHASE

However looking at the fsig going into pvsftr, pvsinfo says it is 
format=1 , which I understand to be AMP_PHASE.

Does anyone know if this would/should work? pvsftw and pvsftr don't 
specifically mention it, but what I'd imagine is that the frequency 
ftable given to pvsftw would actually be written/read as phase instead 
of freq.

I will take a look at the source code at some point if no-one knows. 
Below is what I've tested with:


instr test
	ifts = 2048
	ibins = ifts / 2
	f_, fampphs pvsifd oscil(1, 440), ifts, ifts / 4, 1
	ifnamp ftgen 0, 0, ibins, 2, 0
	ifnphase ftgen 0, 0, ibins, 2, 0
	kready pvsftw fampphs, ifnamp, ifnphase
	i_, i_, i_, iformat pvsinfo fampphs
	prints sprintf("pvsinfo format %d\n", iformat) ; shows 1, which is 
amp_phase
	if (kready == 1) then
		pvsftr fampphs, ifnamp, ifnphase
	endif
endin

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

Date2025-02-19 17:57
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pvsftr with AMP_PHASE
It was a plain old bug, the check was not correct (bad parenthesis balancing).
PR submitted https://github.com/csound/csound/pull/2104
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 19 Feb 2025, at 15:00, Richard Knight  wrote:
>
> *Warning*
>
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>
> I was curious to see if pvsftw and pvsftr worked with AMP_PHASE analysis
> from pvsifd.
>
> pvsftw seems to work without complaining, but then pvsftr fails with
> "pvsftr: signal format must be amp-phase or amp-freq." - which in a way
> is promising as it is saying that it does support AMP_PHASE
>
> However looking at the fsig going into pvsftr, pvsinfo says it is
> format=1 , which I understand to be AMP_PHASE.
>
> Does anyone know if this would/should work? pvsftw and pvsftr don't
> specifically mention it, but what I'd imagine is that the frequency
> ftable given to pvsftw would actually be written/read as phase instead
> of freq.
>
> I will take a look at the source code at some point if no-one knows.
> Below is what I've tested with:
>
>
> instr test
>       ifts = 2048
>       ibins = ifts / 2
>       f_, fampphs pvsifd oscil(1, 440), ifts, ifts / 4, 1
>       ifnamp ftgen 0, 0, ibins, 2, 0
>       ifnphase ftgen 0, 0, ibins, 2, 0
>       kready pvsftw fampphs, ifnamp, ifnphase
>       i_, i_, i_, iformat pvsinfo fampphs
>       prints sprintf("pvsinfo format %d\n", iformat) ; shows 1, which is
> amp_phase
>       if (kready == 1) then
>               pvsftr fampphs, ifnamp, ifnphase
>       endif
> endin
>
> 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

Date2025-02-19 22:09
FromRichard Knight
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pvsftr with AMP_PHASE
Oh wow, thank you, that's great!
Glad to see it was an easy fix & looking forward to having a play with 
the phase values.


On 2025-02-19 17:57, Victor Lazzarini wrote:
> It was a plain old bug, the check was not correct (bad parenthesis 
> balancing).
> PR submitted https://github.com/csound/csound/pull/2104
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 19 Feb 2025, at 15:00, Richard Knight  wrote:
>> 
>> *Warning*
>> 
>> This email originated from outside of Maynooth University's Mail 
>> System. Do not reply, click links or open attachments unless you 
>> recognise the sender and know the content is safe.
>> 
>> I was curious to see if pvsftw and pvsftr worked with AMP_PHASE 
>> analysis
>> from pvsifd.
>> 
>> pvsftw seems to work without complaining, but then pvsftr fails with
>> "pvsftr: signal format must be amp-phase or amp-freq." - which in a 
>> way
>> is promising as it is saying that it does support AMP_PHASE
>> 
>> However looking at the fsig going into pvsftr, pvsinfo says it is
>> format=1 , which I understand to be AMP_PHASE.
>> 
>> Does anyone know if this would/should work? pvsftw and pvsftr don't
>> specifically mention it, but what I'd imagine is that the frequency
>> ftable given to pvsftw would actually be written/read as phase instead
>> of freq.
>> 
>> I will take a look at the source code at some point if no-one knows.
>> Below is what I've tested with:
>> 
>> 
>> instr test
>>       ifts = 2048
>>       ibins = ifts / 2
>>       f_, fampphs pvsifd oscil(1, 440), ifts, ifts / 4, 1
>>       ifnamp ftgen 0, 0, ibins, 2, 0
>>       ifnphase ftgen 0, 0, ibins, 2, 0
>>       kready pvsftw fampphs, ifnamp, ifnphase
>>       i_, i_, i_, iformat pvsinfo fampphs
>>       prints sprintf("pvsinfo format %d\n", iformat) ; shows 1, which 
>> is
>> amp_phase
>>       if (kready == 1) then
>>               pvsftr fampphs, ifnamp, ifnphase
>>       endif
>> endin
>> 
>> 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