MicrophoneArrayBenchmarking / airfoil-in-kevlar-walled-windtunnel

This benchmark case consist of measurements of a NACA63018 airfoil in a Kevlar-walled windtunnel
MIT License
1 stars 0 forks source link

CSM scaling #3

Open esarradj opened 1 month ago

esarradj commented 1 month ago

I revisited the code of both Acoular and aeroacoustics.jl and compared that to scipy welch and matplotlib psd and it seems that Acoular does neither 'density' or 'spectrum' scaling, but a scaling that is equivalent to $\Delta f \cdot$ 'density'. This however the only scaling that seems correct to me if we assume to have random signals because only then it holds that

$p{rms}^2 = \frac{1}{N}\sum{n=0\dots N-1} p(n)^2 = \sum{f} G{xx}(f)$

which means the sum of the spectrum gives me the power as it should be. The 'spectrum' scaling overestimates the power of a random signal.

The factor of 1.5003663... arises from 4096*(np.hanning(4096)**2).sum()/(np.hanning(4096).sum()**2) which is the different scaling between Acoular and aeroacoustics.jl .

1oly commented 1 month ago

Thanks, that's a wonderful explanation. And it's starting to come back to me, that I've scratched my head for hours trying to understand the scaling in scipy and acoular. But this is actually a perfect example of the need for these benchmarks. I will keep the scaling as is, and make a note, that the scaling convention needs to revisited.

esarradj commented 1 month ago

Yes, indeed. This could give a very good example of the advantages of open codes.