Name: Anonymous 2009-09-20 14:22
is this a valid dft implementation ?
float px = 0.0f;
float pw = 0.0f;
float FC_indx = 0.0f;
unsigned long indx = 0;
float FC = _2PI * freq / SAMPLE_RATE;
while (indx < data_len) {
FC_indx = FC * indx;
pw += data[indx] * fastcos(FC_indx);
px += data[indx] * fastsin(FC_indx);
indx++;
}
return sqrt(pw+px);
float px = 0.0f;
float pw = 0.0f;
float FC_indx = 0.0f;
unsigned long indx = 0;
float FC = _2PI * freq / SAMPLE_RATE;
while (indx < data_len) {
FC_indx = FC * indx;
pw += data[indx] * fastcos(FC_indx);
px += data[indx] * fastsin(FC_indx);
indx++;
}
return sqrt(pw+px);