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

Resolving warnings

parent 487daf57
......@@ -90,6 +90,7 @@ namespace ITA
/// \param azimuth azimuth angle for the query direction.
/// \param elevation elevation angle for the query direction.
/// \return the data point for the given direction
/// @todo Check, if integer parameters should be replace by floating point type
///
static std::pair<double, double> FindNearest ( int azimuth, int elevation );
......
......@@ -5,7 +5,7 @@
#include <ITA/SimulationScheduler/definitions.h>
// simulation scheduler includes
#include <ITA/SimulationScheduler/AudibilityFilter/audibility_filter_interface.h>>
#include <ITA/SimulationScheduler/AudibilityFilter/audibility_filter_interface.h>
// std includes
#include <valarray>
......
......@@ -46,7 +46,7 @@ namespace ITA
mean[ 0 ].add_buf( irsVector.at( 0 )[ i ] );
}
mean[ 0 ].div_scalar( irsVector.at( 0 ).GetNumChannels() );
mean[ 0 ].div_scalar( float( irsVector.at( 0 ).GetNumChannels() ) );
return mean;
}
......@@ -78,7 +78,7 @@ namespace ITA
}
// divide by number of objects.
mean.div_scalar( irsVector.size() );
mean.div_scalar( float( irsVector.size() ) );
return mean;
}
......@@ -134,7 +134,7 @@ namespace ITA
inline static void Normalize( ITABase::CMultichannelFiniteImpulseResponse& irs )
{
irs.Normalize();
irs.mul_scalar ( 0.99 );
irs.mul_scalar ( 0.99f );
};
inline static std::valarray<float> NormalizedCrossCorrelation( const ITABase::CFiniteImpulseResponse& x, const ITABase::CFiniteImpulseResponse& y )
......@@ -211,8 +211,8 @@ namespace ITA
const auto m = (std::max)( nx, ny );
const auto mxl = m - 1;
auto X = FFTUtils::FFT ( x, 2 * m );
auto Y = FFTUtils::FFT ( y, 2 * m );
auto X = FFTUtils::FFT ( x, int( 2 * m ) );
auto Y = FFTUtils::FFT ( y, int( 2 * m ) );
auto c = FFTUtils::IFFT ( X * Y.apply ( std::conj ) );
......@@ -237,7 +237,7 @@ namespace ITA
const auto lhsSpectra = ( *FFTUtils::Transform ( lhs ).release ( ) );
const auto rhsSpectra = ( *FFTUtils::Transform ( rhs ).release ( ) );
auto result = new ITABase::CHDFTSpectra ( lhsSpectra.GetSampleRate ( ), lhsSpectra.GetNumChannels ( ), lhsSpectra.GetDFTSize ( ), true );
auto result = new ITABase::CHDFTSpectra ( float( lhsSpectra.GetSampleRate ( ) ), lhsSpectra.GetNumChannels ( ), lhsSpectra.GetDFTSize ( ), true );
for ( auto i = 0; i < lhsSpectra.GetNumChannels ( ); ++i )
{
......
......@@ -104,7 +104,7 @@ namespace ITA
static ITABase::CFiniteImpulseResponse Convert ( const ITASampleBuffer& buffer, double sampleRate = 44100.0 )
{
ITABase::CFiniteImpulseResponse ir ( buffer.GetLength ( ), sampleRate );
ITABase::CFiniteImpulseResponse ir ( buffer.GetLength ( ), float( sampleRate ) );
ir.WriteSamples ( buffer.GetData ( ), buffer.GetLength ( ) );
......
......@@ -117,7 +117,7 @@ namespace ITA
x = x.apply ( std::conj );
// scale the numbers
x /= x.size ( );
x /= ( double ) x.size();
std::valarray<double> result ( x.size ( ) );
......@@ -154,18 +154,14 @@ namespace ITA
}
};
inline std::unique_ptr<ITABase::CHDFTSpectra> FFTUtils::Transform(
const ITABase::CMultichannelFiniteImpulseResponse& irs)
inline std::unique_ptr<ITABase::CHDFTSpectra> FFTUtils::Transform( const ITABase::CMultichannelFiniteImpulseResponse& irs )
{
auto spectra = std::make_unique<ITABase::CHDFTSpectra>(irs.GetSampleRate(), irs.GetNumChannels(),
irs.GetLength(), true);
auto pSpectra = std::make_unique< ITABase::CHDFTSpectra >( float( irs.GetSampleRate() ), irs.GetNumChannels(), irs.GetLength(), true );
for (auto i = 0; i < irs.GetNumChannels(); ++i)
{
(*spectra)[i]->Copy(Transform(DataTypeUtils::Convert(irs[i])).get());
}
for( auto i = 0; i < irs.GetNumChannels(); ++i )
( *pSpectra )[ i ]->Copy( Transform( DataTypeUtils::Convert( irs[ i ] ) ).get() );
return spectra;
return pSpectra;
}
} // namespace Utils
} // namespace SimulationScheduler
......
......@@ -134,7 +134,7 @@ namespace ITA
for ( const auto& val : oJsonNode )
{
values.push_back ( val.as_float ( ) );
values.push_back ( float( val.as_float ( ) ) );
}
std::string sValue;
......
......@@ -92,10 +92,12 @@ namespace ITA
virtual bool IsBusy ( ) const = 0;
};
inline ISchedulerInterface::SchedulerConfig::SchedulerConfig() : sSchedulerType( "Unknown" )
inline ISchedulerInterface::SchedulerConfig::SchedulerConfig()
: SchedulerConfig( "Unkown" )
{ };
inline ISchedulerInterface::SchedulerConfig::SchedulerConfig ( std::string sType ) : sSchedulerType ( m_sSchedulerType )
inline ISchedulerInterface::SchedulerConfig::SchedulerConfig ( std::string sType )
: sSchedulerType ( m_sSchedulerType )
{
m_sSchedulerType = sType;
};
......
......@@ -62,11 +62,10 @@ namespace ITA
newSourceReceiverPair.receiver->GetOrientation ( ),
newSourceReceiverPair.source->GetPosition ( ) );
const auto receiverElevationDelta = abs ( previousReceiverElevationToSource - newReceiverElevationToSource );
const auto receiverAzimuthDelta = abs ( previousReceiverAzimuthToSource - newReceiverAzimuthToSource );
const std::pair<double, double> uncertainty = FindNearest ( previousReceiverAzimuthToSource, previousReceiverElevationToSource );
const std::pair< double, double > uncertainty = FindNearest( int( previousReceiverAzimuthToSource ), int( previousReceiverElevationToSource ) );
const auto receiverElevationDelta = abs( previousReceiverElevationToSource - newReceiverElevationToSource );
const auto receiverAzimuthDelta = abs( previousReceiverAzimuthToSource - newReceiverAzimuthToSource );
// compare delta against this uncertainty
// when bigger -> audible
......@@ -91,7 +90,7 @@ namespace ITA
// condition the arguments for the data as we only have half the azimuth range
azimuth = azimuth % 180;
const auto lowerBoundAz = m_mmLocalizationUncertainty.lower_bound ( azimuth );
const auto lowerBoundAz = m_mmLocalizationUncertainty.lower_bound( azimuth );
std::map<int, std::pair<double, double>> elevationMap;
......
......@@ -69,6 +69,8 @@ namespace ITA
return distanceQuotient > m_dThreshold;
}
ITA_EXCEPT0( MODAL_EXCEPTION );
}
std::string CTranslationFilter::GetType ( )
......
Supports Markdown
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