Skip to contentSkip to conversation

Audigy DSP questions.

DISCUSSION James Courtier-Dutton 2 participants 5 messages Sep 18, 2005 – Sep 20, 2005

lore
Share & tools
lore
#0 lore raw

In emufx.c there is the following table. Can anyone tell me how to convert these values to floating point db gain values? I need to know how to convert values in the DSP to values in the range +2.0 to -2.0

static const u32 db_table[101] = {
        0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540,
        0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8,
        0x0207567a, 0x021fd03d, 0x0239714c, 0x02544792, 0x027061a1,
        0x028dcebb, 0x02ac9edc, 0x02cce2bf, 0x02eeabe8, 0x03120cb0,
        0x0337184e, 0x035de2df, 0x03868173, 0x03b10a18, 0x03dd93e9,
        0x040c3713, 0x043d0cea, 0x04702ff3, 0x04a5bbf2, 0x04ddcdfb,
        0x0518847f, 0x0555ff62, 0x05966005, 0x05d9c95d, 0x06206005,
        0x066a4a52, 0x06b7b067, 0x0708bc4c, 0x075d9a01, 0x07b6779d,
        0x08138561, 0x0874f5d5, 0x08dafde1, 0x0945d4ed, 0x09b5b4fd,
        0x0a2adad1, 0x0aa58605, 0x0b25f936, 0x0bac7a24, 0x0c3951d8,
        0x0ccccccc, 0x0d673b17, 0x0e08f093, 0x0eb24510, 0x0f639481,
        0x101d3f2d, 0x10dfa9e6, 0x11ab3e3f, 0x12806ac3, 0x135fa333,
        0x144960c5, 0x153e2266, 0x163e6cfe, 0x174acbb7, 0x1863d04d,
        0x198a1357, 0x1abe349f, 0x1c00db77, 0x1d52b712, 0x1eb47ee6,
        0x2026f30f, 0x21aadcb6, 0x23410e7e, 0x24ea64f9, 0x26a7c71d,
        0x287a26c4, 0x2a62812c, 0x2c61df84, 0x2e795779, 0x30aa0bcf,
        0x32f52cfe, 0x355bf9d8, 0x37dfc033, 0x3a81dda4, 0x3d43c038,
        0x4026e73c, 0x432ce40f, 0x46575af8, 0x49a8040f, 0x4d20ac2a,
        0x50c335d3, 0x54919a57, 0x588dead1, 0x5cba514a, 0x611911ea,
        0x65ac8c2f, 0x6a773c39, 0x6f7bbc23, 0x74bcc56c, 0x7a3d3272,
        0x7fffffff,
};

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#1 lore raw
Quoted 19 lines · James Courtier-Dutton

In emufx.c there is the following table. Can anyone tell me how to convert these values to floating point db gain values? I need to know how to convert values in the DSP to values in the range
+2.0 to -2.0

static const u32 db_table[101] = {
        0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540,
        0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8,
        0x0207567a, 0x021fd03d, 0x0239714c, 0x02544792, 0x027061a1,
        0x028dcebb, 0x02ac9edc, 0x02cce2bf, 0x02eeabe8, 0x03120cb0,
        0x0337184e, 0x035de2df, 0x03868173, 0x03b10a18, 0x03dd93e9,
        0x040c3713, 0x043d0cea, 0x04702ff3, 0x04a5bbf2, 0x04ddcdfb,
        0x0518847f, 0x0555ff62, 0x05966005, 0x05d9c95d, 0x06206005,
        0x066a4a52, 0x06b7b067, 0x0708bc4c, 0x075d9a01, 0x07b6779d,
        0x08138561, 0x0874f5d5, 0x08dafde1, 0x0945d4ed, 0x09b5b4fd,
        0x0a2adad1, 0x0aa58605, 0x0b25f936, 0x0bac7a24, 0x0c3951d8,
        0x0ccccccc, 0x0d673b17, 0x0e08f093, 0x0eb24510, 0x0f639481,
        0x101d3f2d, 0x10dfa9e6, 0x11ab3e3f, 0x12806ac3, 0x135fa333,
        0x144960c5, 0x153e2266, 0x163e6cfe, 0x174acbb7, 0x1863d04d,
        0x198a1357, 0x1abe349f, 0x1c00db77, 0x1d52b712, 0x1eb47ee6,
Quoted 10 lines
        0x2026f30f, 0x21aadcb6, 0x23410e7e, 0x24ea64f9, 0x26a7c71d,
        0x287a26c4, 0x2a62812c, 0x2c61df84, 0x2e795779, 0x30aa0bcf,
        0x32f52cfe, 0x355bf9d8, 0x37dfc033, 0x3a81dda4, 0x3d43c038,
        0x4026e73c, 0x432ce40f, 0x46575af8, 0x49a8040f, 0x4d20ac2a,
        0x50c335d3, 0x54919a57, 0x588dead1, 0x5cba514a, 0x611911ea,
        0x65ac8c2f, 0x6a773c39, 0x6f7bbc23, 0x74bcc56c, 0x7a3d3272,
        0x7fffffff,
};

I think I have worked it out.
Take each value and divide by 0x80000000 to get a value between 0 and 1. This is then converted into dB with
0 == Mute
0x01571f82 == -19.8 dB
0x7fffffff == 0 dB
With each value being a constant step of 0.2 dB.

James

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#2 lore raw
Quoted 40 lines · James Courtier-Dutton
Quoted 19 lines · James Courtier-Dutton

In emufx.c there is the following table. Can anyone tell me how to convert these values to floating point db gain values? I need to know how to convert values in the DSP to values in the range
+2.0 to -2.0

static const u32 db_table[101] = {
        0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540,
        0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8,
        0x0207567a, 0x021fd03d, 0x0239714c, 0x02544792, 0x027061a1,
        0x028dcebb, 0x02ac9edc, 0x02cce2bf, 0x02eeabe8, 0x03120cb0,
        0x0337184e, 0x035de2df, 0x03868173, 0x03b10a18, 0x03dd93e9,
        0x040c3713, 0x043d0cea, 0x04702ff3, 0x04a5bbf2, 0x04ddcdfb,
        0x0518847f, 0x0555ff62, 0x05966005, 0x05d9c95d, 0x06206005,
        0x066a4a52, 0x06b7b067, 0x0708bc4c, 0x075d9a01, 0x07b6779d,
        0x08138561, 0x0874f5d5, 0x08dafde1, 0x0945d4ed, 0x09b5b4fd,
        0x0a2adad1, 0x0aa58605, 0x0b25f936, 0x0bac7a24, 0x0c3951d8,
        0x0ccccccc, 0x0d673b17, 0x0e08f093, 0x0eb24510, 0x0f639481,
        0x101d3f2d, 0x10dfa9e6, 0x11ab3e3f, 0x12806ac3, 0x135fa333,
        0x144960c5, 0x153e2266, 0x163e6cfe, 0x174acbb7, 0x1863d04d,
        0x198a1357, 0x1abe349f, 0x1c00db77, 0x1d52b712, 0x1eb47ee6,
Quoted 10 lines
        0x2026f30f, 0x21aadcb6, 0x23410e7e, 0x24ea64f9, 0x26a7c71d,
        0x287a26c4, 0x2a62812c, 0x2c61df84, 0x2e795779, 0x30aa0bcf,
        0x32f52cfe, 0x355bf9d8, 0x37dfc033, 0x3a81dda4, 0x3d43c038,
        0x4026e73c, 0x432ce40f, 0x46575af8, 0x49a8040f, 0x4d20ac2a,
        0x50c335d3, 0x54919a57, 0x588dead1, 0x5cba514a, 0x611911ea,
        0x65ac8c2f, 0x6a773c39, 0x6f7bbc23, 0x74bcc56c, 0x7a3d3272,
        0x7fffffff,
};

I think I have worked it out.
Take each value and divide by 0x80000000 to get a value between 0 and 1. This is then converted into dB with
0 == Mute
0x01571f82 == -19.8 dB
0x7fffffff == 0 dB
With each value being a constant step of 0.2 dB.

Quoted 3 lines

James

Did anyone spot the deliberate mistake?

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#3 lore raw
Quoted 9 lines · James Courtier-Dutton
Quoted 8 lines · James Courtier-Dutton

I think I have worked it out.
Take each value and divide by 0x80000000 to get a value between 0 and 1. This is then converted into dB with
0 == Mute
0x01571f82 == -19.8 dB
0x7fffffff == 0 dB
With each value being a constant step of 0.2 dB.

Quoted 5 lines
Quoted 3 lines

James

Did anyone spot the deliberate mistake?

I give up, what is it and why do you think it's deliberate?

Lee

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#4 lore raw
Quoted 16 lines · Lee Revell
Quoted 14 lines · James Courtier-Dutton
Quoted 11 lines · James Courtier-Dutton

I think I have worked it out.
Take each value and divide by 0x80000000 to get a value between 0 and 1. This is then converted into dB with
0 == Mute
0x01571f82 == -19.8 dB
0x7fffffff == 0 dB
With each value being a constant step of 0.2 dB.

James

Quoted 8 lines
Quoted 2 lines

Did anyone spot the deliberate mistake?

I give up, what is it and why do you think it's deliberate?

Lee

The dB values are all half what they should be. Mixed up power and volts.

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php