Commit 8f698360 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Another test routine for 1/3 filter generator

parent b91957cb
......@@ -19,12 +19,15 @@ const int g_iFilterLength = int( 10 * ceil( g_dSampleRate / CThirdOctaveMagnitud
void TestThirdOctaveFilterGeneratorFIRIdentity();
void TestThirdOctaveFilterGeneratorFIRZero();
void TestThirdOctaveFilterGeneratorFIRSingleBands();
void TestThirdOctaveFilterGeneratorFIRDirectivityExample();
int main( int, char** )
{
TestThirdOctaveFilterGeneratorFIRIdentity();
TestThirdOctaveFilterGeneratorFIRZero();
TestThirdOctaveFilterGeneratorFIRSingleBands();
TestThirdOctaveFilterGeneratorFIRDirectivityExample();
return 255;
}
......@@ -76,3 +79,49 @@ void TestThirdOctaveFilterGeneratorFIRSingleBands()
writeAudiofile( sFilePath, &oFilter, g_dSampleRate );
cout << "Exported result to " << sFilePath << endl;
}
void TestThirdOctaveFilterGeneratorFIRDirectivityExample()
{
ITASampleBuffer oFilter( g_iFilterLength, true );
CITAThirdOctaveFIRFilterGenerator oFilterGenerator( g_dSampleRate, g_iFilterLength );
std::vector< float > vfDirectivityMags = { 0.9110f, 0.9110f,
0.9110f,
0.9103f,
0.9092f,
0.9074f,
0.9039f,
0.8980f,
0.8872f,
0.8645f,
0.8262f,
0.7629f,
0.6695f,
0.5598f,
0.4747f,
0.4392f,
0.5202f,
0.8082f,
0.6256f,
0.2545f,
0.3255f,
0.1991f,
0.2711f,
0.2834f,
0.2163f,
0.1293f,
0.0362f,
0.0666f,
0.0367f,
0.0633f,
0.0633f, };
CThirdOctaveGainMagnitudeSpectrum oMags;
oMags.SetMagnitudes( vfDirectivityMags );
oFilterGenerator.GenerateFilter( oMags, oFilter.GetData() );
string sFilePath = "ITADSPThirdOctaveFilterGeneratorTest_DirectivityExample_FIR.wav";
writeAudiofile( sFilePath, &oFilter, g_dSampleRate );
cout << "Exported result to " << sFilePath << endl;
}
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