Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 26611b3e authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing problem with FIR third octave filter generator

parent 5c5cadda
......@@ -62,7 +62,7 @@ public:
void SetDumpFilename( const std::string& sFilename );
// Filter erzeugen
void GenerateFilter( const CITAThirdOctaveMagnitudeSpectrum& oTOMagnitudes, float* pfFilterCoeffs );
void GenerateFilter( const CITAThirdOctaveGainMagnitudeSpectrum& oTOMagnitudes, float* pfFilterCoeffs );
private:
double m_dSamplerate; // Abtastrate der Ausgabefilter [Hz]
......
......@@ -78,18 +78,18 @@ void CITAThirdOctaveFIRFilterGenerator::SetDumpFilename( const std::string& sFil
m_sDumpFilename = sFilename;
}
void CITAThirdOctaveFIRFilterGenerator::GenerateFilter( const CITAThirdOctaveMagnitudeSpectrum& oTOMagnitudes, float* pfFilterCoeffs )
void CITAThirdOctaveFIRFilterGenerator::GenerateFilter( const CITAThirdOctaveGainMagnitudeSpectrum& oTOGainMagnitudes, float* pfFilterCoeffs )
{
m_sw.start();
if( oTOMagnitudes.IsZero() )
if( oTOGainMagnitudes.IsZero() )
{
for( int i = 0; i < m_iFilterLength; i++ )
pfFilterCoeffs[ i ] = 0.0f;
return;
}
if( oTOMagnitudes.IsIdentity() )
if( oTOGainMagnitudes.IsIdentity() )
{
for( int i = 0; i < m_iFilterLength; i++ )
pfFilterCoeffs[ i ] = 0.0f;
......@@ -101,7 +101,7 @@ void CITAThirdOctaveFIRFilterGenerator::GenerateFilter( const CITAThirdOctaveMag
m_pfInputData[ 0 ] = 1.0f;
for( int i = 0; i < CITAThirdOctaveMagnitudeSpectrum::GetNumBands(); i++ )
m_pfInputData[ 1 + i ] = float( db10_to_ratio( oTOMagnitudes[ i ] ) );
m_pfInputData[ 1 + i ] = float( oTOGainMagnitudes[ i ] );
m_pfInputData[ m_iInputFreqs - 1 ] = 0.0f; // @todo jst: check if this is good
// Initialize cubic spline interpolation
......
......@@ -67,7 +67,7 @@ void TestThirdOctaveFilterGeneratorFIRSingleBands()
for( int i = 0; i < CITAThirdOctaveMagnitudeSpectrum::GetNumBands(); i++ )
{
oMags.SetZero();
oMags[ i ] = 0.0f; // dB
oMags[ i ] = 1.0f;
oFilterGenerator.GenerateFilter( oMags, oFilter[ i ].GetData() );
}
......
......@@ -14,3 +14,4 @@ ITADSPThirdOctaveFilterGeneratorTest_Identity_FIR.channelNames = { 'Identity' };
ITADSPThirdOctaveFilterGeneratorTest_Identity_FIR.pf
ITADSPThirdOctaveFilterGeneratorTest_SingleBands_FIR.pf
......@@ -50,11 +50,11 @@ ITADSPThirdOctaveFilterbankTest_IIR_Zeros.pf
ITADSPThirdOctaveFilterbankTest_IIR_SomeBands.pf
%% FIR
fir_zeros = ita_read( 'ITADSPThirdOctaveFilterGeneratorTest_Zero_FIR.wav' );
fir_zeros = ita_read( 'ITADSPThirdOctaveFilterbankTest_FIR_Zeros.wav' );
fir_zeros.signalType = 'power';
fir_unity = ita_read( 'ITADSPThirdOctaveFilterGeneratorTest_Identity_FIR.wav' );
fir_unity = ita_read( 'ITADSPThirdOctaveFilterbankTest_FIR_Identity.wav' );
fir_unity.signalType = 'power';
fir_sb = ita_read( 'ITADSPThirdOctaveFilterGeneratorTest_SingleBands_FIR.wav' );
fir_sb = ita_read( 'ITADSPThirdOctaveFilterbankTest_FIR_SomeBands.wav' );
fir_sb.signalType = 'power';
fir_sb_unity = fir_sb.ch( 1 );
......
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