[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Large FFT Windows



FFT on the server is really geared toward overlap-add calculation. If
I wanted a static FFT of a huge buffer, I'd do it in the client
instead.

// assuming a mono soundfile
f = SoundFile.openRead("sounds/a11wlk01.wav");

d = Signal.newClear(f.numFrames);
f.readData(d);

d = d.extend(d.size.nextPowerOfTwo, 0);

f.close;

c = d.fft(Signal.newClear(d.size), Signal.fftCosTable(d.size));

Now, c.real contains the magnitudes and c.imag the phases.

If you are going to do a lot of these at the same size, you can save
Signal.fftCosTable(*size*) in a variable and reuse the table.

hjh


-- 
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/