2004-01-15, 08:08
i also posted this to the xbmp forums...
i've uploaded my source files using the end user upload page - xbmc_dsp.zip. i didn't get a chance to clean up or document the code yet, so if anyone wants to continue the work they should probably email me so i can explain what's going on. hopefully i have some time to continue to work on it along with the help of others.
i never got it completely working because i got stuck trying to figure out how to do the gui end of things. i also wasn't entirely sure what direction to go with it.
here's a quick rundown of what's in there. i know the style/class names don't match the rest of the code, but it's hard to break old habits.
filter_bank.fx - dsp builder source file of 5 stereo biquad filters
filter_bank.bin - dsp image file ( generated by dsp builder )
filter_bank.h - header file of dsp coefficients ( generated by dsp builder )
dsp.h/cpp - implements dsp::manager_t
guiwindowdsp.cpp - the start of my attempt to implement a dsp control panel
dsp builder ( included in the xdk ) allows you to graphically create a dsp processing chain. the result of the dsp builder compile is a dsp executable image ( *.bin ) and a header file which exposes the dsp coefficients. to download a dsp image you use the lpdirectsound8->downloadeffectsimage
method. one downloaded you can use the seteffectdata method to set a filter parameter. since the parameters exposed are the raw biquad parameters, some amound of parameter coefficent crunching is required to actually use the filters - the filter_t class along with lp_filter_t ( low pass filter ), hp_filter_t ( high pass filter ), and parametric_filter_t ( parametric filter ) help with this process.
generating the coefficients is a little tricky, especially since the documentation is apparently incorrect. i experimentally determined that the mapping of the biquad coefficients was incorrect. this may have been fixed in a later xdk, but i had to implement the following remapping -
dwfiltera1 = coef.b0
dwfiltera2 = coef.b1
dwfilterb0 = coef.b2
dwfilterb1 = coef.a1
dwfilterb2 = coef.a0
if you want to give it a go, good luck! let me know what kind of result you find.
i've uploaded my source files using the end user upload page - xbmc_dsp.zip. i didn't get a chance to clean up or document the code yet, so if anyone wants to continue the work they should probably email me so i can explain what's going on. hopefully i have some time to continue to work on it along with the help of others.
i never got it completely working because i got stuck trying to figure out how to do the gui end of things. i also wasn't entirely sure what direction to go with it.
here's a quick rundown of what's in there. i know the style/class names don't match the rest of the code, but it's hard to break old habits.
filter_bank.fx - dsp builder source file of 5 stereo biquad filters
filter_bank.bin - dsp image file ( generated by dsp builder )
filter_bank.h - header file of dsp coefficients ( generated by dsp builder )
dsp.h/cpp - implements dsp::manager_t
guiwindowdsp.cpp - the start of my attempt to implement a dsp control panel
dsp builder ( included in the xdk ) allows you to graphically create a dsp processing chain. the result of the dsp builder compile is a dsp executable image ( *.bin ) and a header file which exposes the dsp coefficients. to download a dsp image you use the lpdirectsound8->downloadeffectsimage
method. one downloaded you can use the seteffectdata method to set a filter parameter. since the parameters exposed are the raw biquad parameters, some amound of parameter coefficent crunching is required to actually use the filters - the filter_t class along with lp_filter_t ( low pass filter ), hp_filter_t ( high pass filter ), and parametric_filter_t ( parametric filter ) help with this process.
generating the coefficients is a little tricky, especially since the documentation is apparently incorrect. i experimentally determined that the mapping of the biquad coefficients was incorrect. this may have been fixed in a later xdk, but i had to implement the following remapping -
dwfiltera1 = coef.b0
dwfiltera2 = coef.b1
dwfilterb0 = coef.b2
dwfilterb1 = coef.a1
dwfilterb2 = coef.a0
if you want to give it a go, good luck! let me know what kind of result you find.