Commit 7edae76d authored by Armin Erraji's avatar Armin Erraji

In the function Generate(), added calculation of the sound energy decrease due...

In the function Generate(), added calculation of the sound energy decrease due to the path length as well as the phase shift.
parent 8fa0729c
......@@ -115,6 +115,7 @@ void benchmark_single_wedge()
cout << "Starting Kirchoff model benchmark:" << endl;
double dStartTime = ITAClock::getDefaultClock()->getTime();
ITABase::CHDFTSpectrum oTF( g_fSampleRate, g_iFilterLength, true );
for( int i = 0; i < 1e8; i++ )
{
......
......@@ -129,9 +129,10 @@ namespace ITAPropagationModels
};
const double m_dHumidity = 80.0;
const double m_dTemperature = 20.0;
const float m_fSpeedOfSound = 344.0f;
const float m_fSampleRate = 44.1e3;
const int m_iFilterLength = 64;
static struct m_DefaultDiffractionModel //!< Default values for diffractions
......
This diff is collapsed.
......@@ -20,6 +20,8 @@
#include <ITAPropagationModels/FilterEngine.h>
#include <ITAGeo/Base.h>
#include <ITAISO9613.h>
using namespace std;
using namespace ITAConstants;
using namespace ITAGeo;
......@@ -27,9 +29,6 @@ using namespace ITAPropagationModels;
int main(int, char**)
{
const float fSpeedOfSound = 344.0f;
const float fSampleRate = 44.1e3;
const int iFilterLength = 64;
// _______
......@@ -81,8 +80,16 @@ int main(int, char**)
oFilter.ApplyAcousticModels(oPathList);
//Set filter length according to the maximum path length
const float fSpeedOfSound = 344.0f; //Approximation of speed of sound at ~20C
const float fSampleRate = 44.1e3;
const int iFilterLength = (int)(oPathList.GetMaxLength()/ fSpeedOfSound * fSampleRate ) + 1024;
ITABase::CHDFTSpectra oSpectra(fSampleRate, pReceiver->iNumChannels, iFilterLength);
oFilter.Generate(oPathList, oSpectra);
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment