DSP API integration

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Post Reply
norman
Active Member
Posts: 55
Joined: Wed Jan 11, 2012 2:27 pm

DSP API integration

Post by norman »

hello,

I'm trying to integer a part of sc_dsp_filters of github to use biquad filter on the demo application card.
No compilation error. But the audio output is a disaster. I was thinking :
- I am completely wrong and it is not really possible to use the biquads API as easy ?
- I not using the good parameters in my coeffs calculation ? (makecoeffs.java)

i try different solution for the coeffs as "MakeCoeffs -low 400 -fs 96000 -bits 30" fs 96000 as the sample rate and bits 30 because of the volume format in Q2.30 fixed point, i was thinking that the sample is in the same format, seem not...

the xmos website mentioned "DSP processing *
* Optional free software components available from XMOS"
so it must be possible.

any idea ?

thanks,


User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

To start with, use

B0 = 1073741824
B1 = 0
B2 = 0
A1 = 0
A2 = 0

this shold give you unity gain.

If this doen't work, check that your audio stream has MSB to LSB at the correct position and in the correct way, if not use bitrev().
norman
Active Member
Posts: 55
Joined: Wed Jan 11, 2012 2:27 pm

Post by norman »

indeed, with your coeffs, the sound is stable and fine (and with unity gain)

you were talking about instability of IIR filter with high sampling rate and how to solve it with your "High-End Audio" IIR filters if i'm not mistaking, isn't it the same problem here ? Or again the result of the coeffs calculation are completely wrong. thanks for advice.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

If you do not have some extreme filter settings it should not result in a unstable result, but "disaster" sound, maybe.

Do you have a program that can calculate the frequency respone and the impulse response from the coeff's that you calculated ?

Check that the impulse response isn't growing over time, since the frequency response doesn't care if it unstable or not. If you are using a filter with more than unity gain for any frequency, check that the signal or the coeff's doesn't overflow.

For unity gain you will have coeffs that is |-2 2| (with A0=1), but that may not be valid for higher gains, and a fixed implementation may clip, creating an unstable filter instead.

I'm using a modified toolbox to calculate HighShelfing, LowShelfing, Butterworth or Linkwitz-Riley crossover and allpass-filters with my 96/64 bits filter. At least that works flawless (but it is supposed to be "HiEnd" so the error must be less than the LSB of Audio to give "Peace of mind" to the consumer) .
norman
Active Member
Posts: 55
Joined: Wed Jan 11, 2012 2:27 pm

Post by norman »

thanks for this, i'm not sure to have time to progress into this way.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

The easy way is to not use a HighShelving with positive gain, instead use a LowShelwing with negative gain and vice versa. Always using negative gain will result in non clipping coeffs and stable filters.
Post Reply