# [PD] [OT] spectral irregularity to measure noisiness (was Re:about fiddle~)

Charles Henry czhenry at gmail.com
Sat Jan 19 03:38:41 CET 2008

```On Jan 18, 2008 11:48 AM, Matteo Sisti Sette <matteosistisette at gmail.com> wrote:
> Also, I may be missing something, but I think your attached patch only
> calculates the product and sum of the LAST TWO bins. Note you use
> [fexpr~ \$x+\$x[-1]] and [fexpr~ \$x*\$x[-1]]
> where I would use:
> [fexpr~ \$x+\$y[-1]] and [fexpr~ \$x*\$y[-1]]

I don't really know what you two are talking about, but I know what this means.

> [fexpr~ \$x+\$x[-1]] and [fexpr~ \$x*\$x[-1]]
evaluates on every pair of samples.  You get an output vector that looks like:
(x+x[-1],  x+x, x+x, ... , x[N-1] + x[N-2] )
or
(x*x[-1],  x*x, x*x, ... , x[N-1] * x[N-2] )

Whereas,
> [fexpr~ \$x+\$y[-1]] and [fexpr~ \$x*\$y[-1]]
is an accumulator!!!  It will just keep growing and growing.  Consider
the equations in the following way:

[fexpr~ \$x+\$y[-1]]
means  y[n] = y[n-1] + x[n]  for all n

you can expand this by substitution:
y[n] = y[n-2] + x[n-1] + x[n]
y[n] = y[n-3] + x[n-2] + x[n-1] + x[n]
and so on....

suppose we add up terms between arbitrary indexes a and b (could be
more than one block)
y[b]=sum( i = a to b,  x[i])  + y[a]

likewise

[fexpr~ \$x*\$x[-1]]
means y[n] = y[n-1]*x[n]

y[b]=product( i = a to b,  x[i])  * y[a]

if y is ever zero, it will always be zero after that...so, to use
this, you would have to seed the values of y using the set y1 command.
I always check this bookmark for reference because I need it all the
time!