Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Need some specifics on the FFT samples sent to plugins via GetSongSamples

This topic is old and might contain outdated or incorrect information.

werwathHome userMember since 2006
My question is basically this: How does the array index used in GetSongSamples translate to a frequency domain sample ? (e.g. What index corresponds to 3000Hz ? (I am assuming here that the array of data that is passed from GetSongSamples is a frequency domain FFT)

I read the documenation in VdjDsp2.h but was not able to detemine the answer.
(I admit my knowledge of FFT is rusty - if not completely lacking)




This is my quesiton in the context of the actual code:
-------------------------------------------------------------
HRESULT __stdcall Cmy_plugin1::OnComputeNewSamples(int pos,int nb,short *buffer)
{

short *samples;
HRESULT res=GetSongSamples(pos,nb,&samples);if(res) return res;
int i;for(i=0;i<nb;i++)
{
//QUESTION - How does i translate to a specific frequency domain sample ?
//For example, what frequency are we processing when i = 30 ?
//Similarily, what i is is 3000Hz ?

int v=samples;
int l=LEFTCHAN(v);
int r=RIGHTCHAN(v);
// Do whatever you want to "l" and "r" values
LIMITER(l);
LIMITER(r);
buffer=MAKECHAN(l,r);
}
return S_OK;
}

And... thanks to all the coders, experts and djs on this list. You all have helped me a lot and I hope to repay the favor someday.
 

Posted Sun 12 Feb 06 @ 5:57 pm
FFTframelength must be power of 2 for example 8192, 1024, 512...

samplerate is 44100 samples/second
so I assume


3000=i*44100/framelenghth

so for framelength 8192 the i is

i=3000*framelength/44100

i=557

Someone correct me if I screwed something :-).



 

Posted Tue 14 Feb 06 @ 6:05 pm
Hi master Lopez453 ;-)

I agree with you.

But can you explain me what the reason to change the framelenght for?
In my plugins, framelenght is always 4096.
 

Posted Wed 22 Feb 06 @ 11:27 pm
Hello Deun-Deun,
framesize is the number of frequency-bands the time interval is converted into.
In other words how detailed is the conversion from time domain to frequency domain.
The smaller the framesize the faster(less CPU usage), but lower quality.

Try some very low setting and see for yourself.

 

Posted Mon 27 Feb 06 @ 10:18 am


(Old topics and forums are automatically closed)