Hello again,
I finally have a simple FIR filter working.
It uses the vDSP_conv function from the Aceleration framework.
But at a filter size of 2000 it already uses 50% of the cpu time.
I'm using a duo Intel core mac-Mini.
I filter a 44.1Kc stereo signal, so (at 2000 coefficients) I uses a
total of about 180M multiply/accumulate operations.
This seems to consumes 50% of two cpus (each about 1.6GHz).
So I think the hardware acceleration is not working.
Anybody an idea why not? Is it not supported on a mac Intel?
This is the main part of the Process function:
note: bufIR containts the filter coefficients (size is ROOMCORRECTION_FILTSIZE)
// add
input samples to end of bufSignal
//
first move bufIn contents
for
(i=0 ; i<ROOMCORRECTION_FILTSIZE-1 ; i++) {
bufSignal[i] = bufSignal[nSampleFrames+i];
}
// add
new samples
for
(i=0 ; i<nSampleFrames ; i++) {
bufSignal[ROOMCORRECTION_FILTSIZE-1+i] =
*sourceP;
sourceP += inNumChannels;
}
//
convolution
vDSP_conv(bufSignal,1,bufIR+ROOMCORRECTION_FILTSIZE-1,-1,bufResult,1,nSampleFrames,ROOMCORRECTION_FILTSIZE);
//
copy result
for
(i=0 ; i<nSampleFrames ; i++) {
*destP = bufResult[i] * gain;
destP += inNumChannels;
}