First out, one of the fastest implementation: Fixed with a int32 filter-coeff, int32 signal and int64 accumulator.
The inputsignal is scaled from fixed 24 bits (Simulating a 24 Audio CODEC) to 30 bits which is the maximum possible amplification without creating overflow in the accumulator. (Overflow checking is done after each MAC)
The calculation is done on the real XS1-L1A chip, so no simulations of the chip is used to create the result.
The input signal is a windowed log chirp starting at 5 Hz ending at 24 kHz after 10 s @ 48kHz.
The filter is a second order (1 Hp+1 Lp) BP-filter [20 40]Hz @ 48 kHz. You could think of it as the lowest band of a 10 band octave equaliser. (It's common to use up to 3 bands / octave in Audio)
Finally MATLAB compares the result with computing the filter-respone with double float and calculates the error beween the double and the fixed implementation.
fixed_32-32-64.png
Below, the PSD of the calculated error.
PSD_fixed_32-32-64.png
To relate this to some dynamic, we need to compare it to the PSD of the inputsignal to the system.
Here the quotient of the cross power spectral density (Pyx) of the chirp x and the filter output y and the power spectral density (Pxx) of x is calculated. Txy=(Pxy)/(Pxx)
Txy_fixed_32-32-64.png
The dynamics in dB of the filter is worse than a 3$ 24-bit CODEC => No "HiFi" filter!
General XC implemetation of this filter form. (Not the fastest implementation)
x is the inputsignal to the filter and y is the output. B and A holds the filter coeff.
Code: Select all
X[0]=x<<6;
h=0;l=0;
for (j=0; j<3; j++){
{h, l} = macs(B[j], X[j], h, l);
{h, l} = macs(A[0], Y[0]<<1, h, l);
{h, l} = macs(A[1], Y[1], h, l);
y=h<<1;
X[2]=X[1];
X[1]=X[0];
Y[1]=Y[0];
Y[0]=y;
return (y>>6);
You do not have the required permissions to view the files attached to this post.