Ross I'd say the power function, in binary math e^x and 10^x are equally difficult to compute, by thowing in ln(10) as a constant, I was doubling the calcs (having said that you could have init ln(10) once in the unit)
Didn't know about the power function though so I learnt something Neven ----- Original Message ----- From: "Ross Levis" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 9:15 PM Subject: Re: [DUG]: db calculation > Sorry, I was giving it -6 not -3. It produces 0.5012 which I guess must be > right. I also found the Power function in the Math unit so this also works: > > power(10,db/10). I'm not sure which one is more efficient. Any takers? > > Cheers, > Ross. > > Neven MacEwan wrote: > > >Ross > > > >exp() is a natural log, ie exponential of e, not exponential of 10 > >Delphi has a log10 function but no Exp10 function I can see so > >To do this you do use > > > >exp(db/10*ln(10)) > > > >HTH > > > >Neven > >----- Original Message ----- > >From: "Ross Levis" <[EMAIL PROTECTED]> > >To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> > >Sent: Thursday, March 06, 2003 4:54 PM > >Subject: Re: [DUG]: db calculation > > > > > > > > > >>Hi > >> > >>This formula doesn't seem to work. The 20 should be 10 as Neven pointed > >>out but I believe a -3db reduction should take 65535 to 32767 but it's > >>not close. Any ideas? > >> > >>Cheers, > >>Ross. > >> > >>Nello Sestini wrote: > >> > >> > >> > >>> (db/20) > >>>P1 = P2 e > >>> > >>>i.e. P1 = P2*exp(db/20) > >>> > >>> > >>>not sure if this is what you are after > >>>(and hope i haven't made some stupid mistake) > >>> > >>> > >>> > >>>-ns > >>>http://www.roserox.co.th > >>> > >>> > >>>----- Original Message ----- > >>>From: "Ross Levis" <[EMAIL PROTECTED] > >>><mailto:[EMAIL PROTECTED]>> > >>>To: "Multiple recipients of list delphi" <[EMAIL PROTECTED] > >>><mailto:[EMAIL PROTECTED]>> > >>>Sent: Thursday, March 06, 2003 09:57 > >>>Subject: [DUG]: db calculation > >>> > >>> > >>> > >>>>Here's a maths question for you. I've never been that good at maths, > >>>>particularly logarithms > >>>> > >>>>Does anyone know the formula to alter an integer value by a particular > >>>>db value. > >>>> > >>>>I'm working on an audio app and I need to alter the volume by a > >>>>particular db setting. The volume can be anywhere in the range 0 > >>>>(silent) to 65535 (maximum). > >>>> > >>>>I know that db = 20 log (P1/P2) though I've also seen the 20 at 10. > >>>> > >>>> > >>>How > >>> > >>> > >>>>do I get P1 (or is it P2) to the left of the equation. > >>>> > >>>>Thanks, > >>>>Ross Levis. > >>>> > >>>> > >>>> > >>>> > >>-------------------------------------------------------------------------- > >> > >> > >- > > > > > >>>> New Zealand Delphi Users group - Delphi List - > >>>> > >>>> > >>>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > >>> > >>> > >>>> Website: http://www.delphi.org.nz > >>>>To UnSub, send email to: [EMAIL PROTECTED] > >>>> > >>>> > >>><mailto:[EMAIL PROTECTED]> > >>> > >>> > >>>>with body of "unsubscribe delphi" > >>>>Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > >>>> > >>>> > >>>> > >> > >>-------------------------------------------------------------------------- > >> > >> > >- > > > > > >> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > >> Website: http://www.delphi.org.nz > >>To UnSub, send email to: [EMAIL PROTECTED] > >>with body of "unsubscribe delphi" > >>Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > >> > >> > >> > >> > > > >--------------------------------------------------------------------------- > > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > > Website: http://www.delphi.org.nz > >To UnSub, send email to: [EMAIL PROTECTED] > >with body of "unsubscribe delphi" > >Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > > > > > > > > > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
