Dear Pd users,
Can you please take a look in the attached patch and see if it's a corret implementation of a spectral flux measure. Basically it's:
inlet~ block~ (blocksize 1 1)
|
rfft~
|\ |
*~ *~
| /
sqrt
|
fexpr~ $x-$y
|
max~ 0
|
snapshot~
|
/ (blocksize)
|
outlet
Thanks in advance.
Best,
Gilberto
_________________________________________________________________
Você sabia que com o Hotmail você tem espaço ilimitado para guardar seus e-mails? Começe a usar já!
http://www.microsoft.com/brasil/windows/windowslive/products/hotmail.aspx
Based on a definition here: http://en.wikipedia.org/wiki/Spectral_flux
I guess you want to take the difference between the power spectral densities (PSD) of successive blocks. Your fexpr~ statement won't do that. You need to delay one copy of the PSD signal by a whole block and subtract it from the current PSD--it's easy to do with delread~/delwrite~.
Then, write the contents to a table with tabwrite~ , and use expr to sum up the values in the table. See the expr documentation here: http://crca.ucsd.edu/~syadegar/expr.html
Chuck