mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: noiseModel - report missing octave bands
This commit is contained in:
@ -78,6 +78,7 @@ void Foam::noiseModel::setOctaveBands
|
|||||||
|
|
||||||
// Centre frequencies
|
// Centre frequencies
|
||||||
DynamicList<scalar> fc;
|
DynamicList<scalar> fc;
|
||||||
|
DynamicList<scalar> missedBins;
|
||||||
|
|
||||||
// Convert to lower band limit
|
// Convert to lower band limit
|
||||||
fTest /= fRatioL2C;
|
fTest /= fRatioL2C;
|
||||||
@ -91,9 +92,12 @@ void Foam::noiseModel::setOctaveBands
|
|||||||
if (f[i] >= fTest)
|
if (f[i] >= fTest)
|
||||||
{
|
{
|
||||||
// Advance band if appropriate
|
// Advance band if appropriate
|
||||||
|
label stepi = 0;
|
||||||
while (f[i] > fTest)
|
while (f[i] > fTest)
|
||||||
{
|
{
|
||||||
|
if (stepi) missedBins.append(fTest/fRatio*fRatioL2C);
|
||||||
fTest *= fRatio;
|
fTest *= fRatio;
|
||||||
|
++stepi;
|
||||||
}
|
}
|
||||||
fTest /= fRatio;
|
fTest /= fRatio;
|
||||||
|
|
||||||
@ -113,6 +117,16 @@ void Foam::noiseModel::setOctaveBands
|
|||||||
|
|
||||||
fBandIDs = bandIDs.sortedToc();
|
fBandIDs = bandIDs.sortedToc();
|
||||||
|
|
||||||
|
if (missedBins.size())
|
||||||
|
{
|
||||||
|
label nMiss = missedBins.size();
|
||||||
|
label nTotal = nMiss + fc.size() - 1;
|
||||||
|
WarningInFunction
|
||||||
|
<< "Empty bands found: " << nMiss << " of " << nTotal
|
||||||
|
<< " with centre frequencies " << flatOutput(missedBins)
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (fc.size())
|
if (fc.size())
|
||||||
{
|
{
|
||||||
// Remove the last centre frequency (beyond upper frequency limit)
|
// Remove the last centre frequency (beyond upper frequency limit)
|
||||||
|
|||||||
Reference in New Issue
Block a user