> On Feb 23, 2018, at 12:17 PM, Julius Smith <[email protected]> wrote:
> 
> Hi Mykle,
> 
> Yes, iFFT takes spectral-bin signals in parallel.  Right now they all
> run at the full audio sampling rate, but later we should be able to
> downsample as is typical.

Thanks.  Clearly I have wandered in over my head, math-wise.
But after reading all weekend, I think I now (sort of) understand 
the difference between the real and the complex FFT.  Or so I’d like
to prove to myself, by making this algorithm work in Faust. =)

Nevertheless, I’m still struggling.  I expect this to work, and it doesn’t:

import("stdfaust.lib”);
process = no.noise : an.rtocv(N) : an.fft(N) : par(f, N, (/(denom(f)^beta), _ 
)) : an.ifft(N) : ba.selectn(N*2, 0)
with {
  N=8;
  hN = N/2;
  beta = hslider("beta", 1, 0, 3, 0.01);
  // Convert par() index to appropriate coefficient for pos & neg freqs 
produced by complex fft
  // For instance: 0 1 2 3 4 5 6 7 -> 4 3 2 1 1 2 3 4
  denom(f) = ba.if(f < hN, hN-f, f+1 - hN);
};


And while trying to debug that myself, I hit an even bigger snag
with selectn().  The code below seems pretty straightforward,
but it does not work at all like I expect, and I haven’t a clue why not:


import("stdfaust.lib");
process = par(i, N, (2*i, 2*i+1)) : par(i, 16, hbargraph("[%2i]value %i", 0, 
20)) 
  : ba.selectn(16, pick) : hbargraph("selected value", 0, 20)
with {
  N=8;
  pick = hslider(“pick a value", 0, 0, 15, 1);
};


(Possibly this is because selectn() expects an integer?
The SVG shows me that the hslider is producing floats, 
even though there’s not a decimal point in this program.)

> Note that for 1/f noise there is a spectral_tilt function in
> filters.lib that will provide a 1/f filter for white noise as a
> special case.  More generally it can provide 1/f^alpha over the entire
> audio band, for any alpha, to any desired degree of accuracy.
> Moreover, alpha can be safely modulated over time as that only moves
> the zeros of the filter.

Thank you!  For any sort of practical use, I’m sure that would be ideal.
At the moment I’m just researching the various different approaches to 
synthesizing 1/f noise.  I expect this one to be the slowest.
I wanted to see if I could code in Faust, as a learning exercise.  
(Boy, am I learning …)

-mykle-



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to