strange dsp filter results

Technical questions regarding the XTC tools and programming with XMOS.
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

strange dsp filter results

Post by voodoosound »

Hi everyone,

some time ago i had some trouble with the sc_dsp module.

i calculated the low pass filter biquad coeffs with octaves butter function.
octave shows a correct plot, but when i implement it in xmos, somethings going wrong.

the scratched red line is the result of the xmos implementation, while the blue line shows the octave plot.

does anyone have an idea where i have to look?

regards
Ck
You do not have the required permissions to view the files attached to this post.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

What happens if you run the filter with the test signal and then put zeros to the filterinput. Does the filter output decline to zero, or does it cont. to output a signal with a large output-power?

Have you checked that you have the correct little/big endian. If you are using a CODEC you might need to use bitrev().

Test with b0=2^23, a0=2^24 , b1=b2=a1=a2=0, and check if the output is -6 dB.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

The butter function in octave works fine for me to generate coefficients. Newer and older versions work equally. Your problem is probably not that.

I am not familiar with the sc_dsp module, so can't help there. It uses 24 bit coeffecients, and not 32?
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

hi lilltroll,
bitrev was not the solution. i already tried that.
today i will try the -6dB approach that you proposed, but i have only access to my xmos devs via ssh. so i will post the test results tonight...

i had tested it with pink noise and the gpio bypasses the filter, witch works fine.

Thanks and regards
Ck
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

Hi,
I now have my stuff running with the coeffs:

Code: Select all

#define BANKS 1
#define DBS 1
#define FRACTIONALBITS 24

Code: Select all

{712, 1424, 712, -33243885, 16469521},
and i measure the attached response lpf_butter.png.

with your proposed test i have the response shown in test_coeffs.png

the red linbe is the bypassed signal

Code: Select all

{8388608, 0,0,0,0},
i also tried bitrev again, but it didnt make any difference.
You do not have the required permissions to view the files attached to this post.