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

Re: [sc-dev] [approve?] PV_Correlation etc

I committed FFT.sc with PV_Add and PV_Mul definitions.

There appears to be some rogue code in FFT_UGens.cpp

	SndBuf *m_fftsndbuf;
	float *m_fftbuf;
	int m_pos, m_bufsize, m_mask;
	int m_log2n, m_stage, m_whichOverlap;
	int m_stride;
	float m_fftbufnum;

precedes FFT_Ctor body in file scope. Haven't checked
in its removal yet, will do if you want. 

I spent today learning how the FFT UGens really work.
I hacked up a dodgy running fast convolver by zeroing
half of the input buffers and letting overlap add sort
it out. Will attempt a better model in a single
Convolver UGen (following ch18 of The Scientist and
Engineer's Guide to Digital Signal Processing), but
will have to write my own FFT and IFFT components as
James suggested. At least I see now in principle how
to go about this. I thought before today there was
some special spectral rate thing going on, but no, its
the same stuff as for all the ar and kr UGens
underneath, just using a bufnum of -1 to indicate if
frame data is not yet available to be processed.   

Do I have permission to eventually commit the FFT work
I'll be doing to SC? It may be very useful to separate
out the common parts of FFT_UGens (like the macros and
functions like Copy) into a header file so I don't
overload the FFT_UGens.cpp file, or do you want it all
kept in one long file? 

I ask now because I'll work at this over Xmas but
won't have frequent or fast internet access. No-one is
planning any big Pv UGens shakeup I should know about?


PS I've worked out how to do feature extractors, for
anyone interested, problem was in using the PV_GET_BUF
macro, which contains a return clause. You have to
check yourself if the spectral info is ready (ie
bufnum not minus one) then run whatever feature
detection, storing the output value for that frame in
a member variable. You can then return that current
frame value on every call to next. 


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now