Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Proposed use of function tables as windows in phase vocoders

Date2007-08-18 18:22
FromVictor Lazzarini
SubjectRe: [Cs-dev] Proposed use of function tables as windows in phase vocoders
Not in CVS, though. It seems to support only
Hamming/hanning and Kaiser (internally) and f-tables.
from pvsanal.c:

static CS_NOINLINE int PVS_CreateWindow(CSOUND *csound,
MYFLT *buf,
                                        int type, int
winLen)
{
    double  fpos, inc;
    MYFLT   *ftable;
    int     i, n, flen, even;

    even = (winLen + 1) & 1;
    switch (type) {
      case 0:   /* Hamming */
        hamming(buf, (winLen >> 1), even);
        return OK;
      case 1:   /* Hanning */
        vonhann(buf, (winLen >> 1), even);
        return OK;
      case 2:   /* Kaiser */
        {
          double  beta = 6.8;
          double  x, flen2, besbeta;
          flen2 = 1.0 / ((double)(winLen >> 1) *
(double)(winLen >> 1));
          besbeta = 1.0 / besseli(beta);
          n = winLen >> 1;
          x = (even ? 0.5 : 0.05);
          for (i = 0; i < n; i++, x += 1.0)
            buf[i] = (MYFLT)(besseli(beta * sqrt(1.0 - x * x
* flen2))
                              * besbeta);
          buf[i] = FL(0.0);
        }
        return OK;
      default:
        if (type >= 0)
          return csound->InitError(csound, Str("invalid
window type"));
    }
    /* use table created with GEN20 */
    flen = csound->GetTable(csound, &ftable, -(type));
    if (flen < 0)
      return csound->InitError(csound, Str("ftable for
window not found"));
    inc = (double)flen / (double)(winLen & (~1));
    fpos = ((double)flen + (double)even * inc) * 0.5;
    n = winLen >> 1;
    /* this assumes that for a window with even size, space
for an extra */
    /* sample is allocated */
    for (i = 0; i < n; i++) {
      double  frac, tmp;
      int     pos;
      frac = modf(fpos, &tmp);
      pos = (int) tmp;
      buf[i] = ftable[pos] + ((ftable[pos + 1] -
ftable[pos]) * (MYFLT) frac);
      fpos += inc;
    }
    buf[n] = (even ? FL(0.0) : ftable[flen]);
    return OK;
}

I suppose you have not commited these additions,
have you?

Victor

>
> In pvsanal I have Rectangular, Hamming, von Hann, Blackman
> , Blackman_exact, Nuttall_C3, Blackman-Harris_3 and
> Blackman-Harris_min
>
> ==John ffitch
>
> ----------------------------------------------------------
> --------------- This SF.net email is sponsored by: Splunk
> Inc. Still grepping through log files to find problems?
> Stop. Now Search log events and configuration files using
> AJAX and a browser. Download your FREE copy of Splunk now
> >>  http://get.splunk.com/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-08-19 08:42
Fromjpff
SubjectRe: [Cs-dev] Proposed use of function tables as windows in phase vocoders
I was referring to SDFT which is in CVS and supports those windows.  I
fundamentally cannot do Kaiser as you noted, and a table is possible
but too expensive in reality.
  I was intending adding the Blackman series to the jumping version as
well.  This is all work in progress that I am still wildly hoping to
finish for 5.07 (as I promised AHRC)

==John ffitch

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net