Commit 01408a1c authored by michael.kohnen's avatar michael.kohnen

Update SH functions for ambisonics

parent b72e5aea
......@@ -465,21 +465,20 @@ int SHKronecker( const int m )
}
std::vector<double> SHRealvaluedBasefunctions( const double elevation, const double azimuth, const int maxOrder )
std::vector<double> SHRealvaluedBasefunctions( const double elevation_rad, const double azimuth_rad, const int maxOrder )
{
std::vector<double> Y;
Y.resize( ( maxOrder + 1 )*( maxOrder + 1 ) );
Y = SHAssociatedLegendre( maxOrder, cos( elevation ) );
Y = SHAssociatedLegendre( maxOrder, cos( elevation_rad ) );
for( int n = 0; n <= maxOrder; n++ )
{
//Y[SHDegreeOrder2Linear(0,n)]*=Y[SHDegreeOrder2Linear(0,n)]*SHNormalizeConst(0,n);
Y[ SHDegreeOrder2Linear( 0, n ) ] *= SHNormalizeConst( 0, n );
for( int m = 1; m <= n; m++ )
{
double Normalizing = SHNormalizeConst( m, n );
Y[ SHDegreeOrder2Linear( m, n ) ] *= cos( m*azimuth )*Normalizing;
Y[ SHDegreeOrder2Linear( -m, n ) ] *= sin( m*azimuth )*Normalizing;
Y[ SHDegreeOrder2Linear( m, n ) ] *= cos( m*azimuth_rad )*Normalizing;
Y[ SHDegreeOrder2Linear( -m, n ) ] *= sin( m*azimuth_rad )*Normalizing;
}
}
return Y;
......
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