On 11/23/2011 10:16 AM, Fons Adriaensen wrote:

The code reproduced below is a cleaned up version of an algorithm
I found somewhere (and don't remember where).

could have been http://sengpielaudio.com/calculator-air.htm

float airabs (float p, float t, float r, float f)
{
     float C, h, tr, frO, frN;

     p /= 101325.0f;
     t += 273.15f;
     C = 4.6151f - 6.8346f * powf ((273.15f / t), 1.261f);
     h = r * powf (10.0f, C) * p;
     tr = t / 293.15f;
     frO = p * (24 + 4.04e4f * h * (0.02f + h)/(0.391f + h));
     frN = p * powf (tr, -0.5f) * (9 + 280 * h * exp (-4.17f * (powf (tr, 
-1/3.0f) - 1)));
     return 8.686f * f * f * (1.84e-11f * sqrt (tr) / p
            + powf (tr, -2.5f) * (  0.01275f * (expf (-2239.1f / t) / (frO + f 
* f / frO))
                                  + 0.10680f * (expf (-3352.0f / t) / (frN + f 
* f / frN))));
}


--
Jörn Nettingsmeier
Lortzingstr. 11, 45128 Essen, Tel. +49 177 7937487

Meister für Veranstaltungstechnik (Bühne/Studio)
Tonmeister VDT

http://stackingdwarves.net

_______________________________________________
Sursound mailing list
[email protected]
https://mail.music.vt.edu/mailman/listinfo/sursound

Reply via email to