DriverHeaven.net

 
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
LinkBack Thread Tools
Old Dec 4, 2003, 11:20 AM   #1
DriverHeaven Addict
 
Join Date: Dec 2002
Posts: 259
Rep Power: 0
eyagos is on a distinguished road

Peak plugin with one register less

Well, the actual code of peak is

Quote:
; Registers
input peak_l, peak_r;
static result_l=0x0, result_r=0x0, resolution=0x1f;
temp tmp

; Code
log tmp, peak_l, resolution, 0x1;
limit result_l, tmp, tmp, result_l;
log tmp, peak_r, resolution, 0x1;
limit result_r, tmp, tmp, result_r;
Here the logarithm of the input (in abs value) is taken, and the dll uses a formula to convert it into the sacle of the vumeter gaph.

But is not necesary to take the logarithm of the input. If you just take the abs of the inputs (the resolution=0x1F register is not needed there), and uses a different formula in the dll to ake the conversion, the result would be exactly the same


Quote:
; Registers
input peak_l, peak_r;
static result_l=0x0, result_r=0x0
temp tmp

; Code
tstneg tmp, peak_l, peak_l, 0x0;
limit result_l, tmp, tmp, result_l;
tstneg tmp, peak_r, peak_r, 0x0;
limit result_r, tmp, tmp, result_r;
Only modifying the conversion formula in the dll, the result would be exactly the same.
eyagos is offline   Reply With Quote


Old Dec 4, 2003, 12:22 PM   #2
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,037
Rep Power: 56
Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!

sounds reasonable. I'll have a look -- thanks

/E
Eugene Gavrilov is offline   Reply With Quote
Old Dec 13, 2003, 09:36 AM   #3
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,418
Rep Power: 47
Max M. will become famous soon enough

(btw. E. this is exactly like in ufx's peakmeter and i wrote to you about this)
In fact, "log" (as well as "exp") instruction of fx8010 is just an approximation so it gives ~0.5dB error at every "2*(n+1)*3db" peakmeter value... So method with "linear" dsp code and linear->logarithmic conversion with kxl (e.g. using C) is preferred...
__________________

Last edited by Max M.; Dec 13, 2003 at 10:45 AM.
Max M. is offline   Reply With Quote
Reply

Bookmarks

Thread Tools