From: Mark Shore on
"Johannes Buechler" <jb_spam(a)gmx.DELnet> wrote in message <hpkunp$9sg$1(a)fred.mathworks.com>...
> Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <06b4754e-1c5d-4985-
> > If you want the correct numbers you need to calibrate
> > your measurement system. That's a not at all trivial
> > task, which requires you to determine the (possibly frequency
> > dependent and nonlinear) scaling coefficients throughout
> > your measurement system.
> >
> > Rune
>
> Hi Rune,
>
> the system is calibrated of course. This is why the graph from the measurement system shows the correct pressure levels. The same values are exported, so they should also be correct in the Matlab plot. The question is, what is wrong in the Matlab calculation? Anyway, thanks for the hint.
>
> Joe

(Delayed posting effect in action.) But I'd guess you don't have the source code for the PAK software, so are you certain that it isn't applying calibration or scaling factors to the instrument output?
From: Johannes Buechler on
"Mark Shore" <mshore(a)magmageosciences.ca> wrote in message <hpl0kf$e22$1(a)fred.mathworks.com>...
> "Johannes Buechler" <jb_spam(a)gmx.DELnet> wrote in message <hpkunp$9sg$1(a)fred.mathworks.com>...
> > Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <06b4754e-1c5d-4985-
> > > If you want the correct numbers you need to calibrate
> > > your measurement system. That's a not at all trivial
> > > task, which requires you to determine the (possibly frequency
> > > dependent and nonlinear) scaling coefficients throughout
> > > your measurement system.
> > >
> > > Rune
> >
> > Hi Rune,
> >
> > the system is calibrated of course. This is why the graph from the measurement system shows the correct pressure levels. The same values are exported, so they should also be correct in the Matlab plot. The question is, what is wrong in the Matlab calculation? Anyway, thanks for the hint.
> >
> > Joe
>
> (Delayed posting effect in action.) But I'd guess you don't have the source code for the PAK software, so are you certain that it isn't applying calibration or scaling factors to the instrument output?

Hello Rune and Mark,

this thread is pointing to the wrong direction. I guess I did not deliver the right facts & figures.

Tomorrow at work I'll re-post, showing that the numerical values of the time data are the same in Matlab and in the measurement system. Only the SPL of the FFT leads to different numerical values. So something is wrong with my Matlab code.

As for PAK: Of course it does apply calibration factors to the data stream. And this calibration factor makes the numerical values directly express the amount of Pascals that the sound pressure has. The measurement microphone has a sensitivity of approx. 50 mV/Pa and a flat frequency response in audible frequency range (that is why it costs several thousand Euros). The measurement system (PAK) knows this value because it is set in the properties of the measurement channel, and with a calibrator that creates exactly 1 Pa and put on the microphone the calibration factor is determined to something very close to 1.00 (for instance, 1.02 which means that the microphone has almost but not quite precisely 50 mV/Pa.

Example: A "1" in the data stream means 1.00000000 Pa, which is 20*log(1/2E-5) dB = 93,9794 dB. So if I plot the time data, it will show a "1". If I plot SPL, it should show 94 dB. In both cases, also under Matlab. But only if the calculation is correct that I make.....
From: Rune Allnor on
On 8 apr, 18:03, "Johannes Buechler" <jb_s...(a)gmx.DELnet> wrote:
> Rune Allnor <all...(a)tele.ntnu.no> wrote in message <06b4754e-1c5d-4985-
> > If you want the correct numbers you need to calibrate
> > your measurement system. That's a not at all trivial
> > task, which requires you to determine the (possibly frequency
> > dependent and nonlinear) scaling coefficients throughout
> > your measurement system.
>
> > Rune
>
> Hi Rune,
>
> the system is calibrated of course. This is why the graph from the measurement system shows the correct pressure levels. The same values are exported, so they should also be correct in the Matlab plot. The question is, what is wrong in the Matlab calculation?

The most likely explanation is that you process the raw,
uncalibrated data in matlab, whereas the other package
uses additional calibration information.

The basic principle is that one records a signal from
a source with known parameters (the calibration source),
determines the relevant calibration parameters from this
recording, and then applies the calibration parameters
as a pre-processing step in subsequent processing.

So the data that comes from the recorder - and are stored
to file - will be dumped before any calibration information
has been applied.

Rune
From: Godzilla on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <a9ad38ca-84ed-40cd-96ef-b11aa4cb9e3d(a)11g2000yqr.googlegroups.com>...
> On 8 apr, 18:03, "Johannes Buechler" <jb_s...(a)gmx.DELnet> wrote:
> > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <06b4754e-1c5d-4985-
> > > If you want the correct numbers you need to calibrate
> > > your measurement system. That's a not at all trivial
> > > task, which requires you to determine the (possibly frequency
> > > dependent and nonlinear) scaling coefficients throughout
> > > your measurement system.
> >
> > > Rune
> >
> > Hi Rune,
> >
> > the system is calibrated of course. This is why the graph from the measurement system shows the correct pressure levels. The same values are exported, so they should also be correct in the Matlab plot. The question is, what is wrong in the Matlab calculation?
>
> The most likely explanation is that you process the raw,
> uncalibrated data in matlab, whereas the other package
> uses additional calibration information.
>
> The basic principle is that one records a signal from
> a source with known parameters (the calibration source),
> determines the relevant calibration parameters from this
> recording, and then applies the calibration parameters
> as a pre-processing step in subsequent processing.
>
> So the data that comes from the recorder - and are stored
> to file - will be dumped before any calibration information
> has been applied.
>
> Rune

the window function will affect the fft amplitude estimates. did you compensate?
From: Johannes Buechler on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <a9ad38ca-84ed-40cd-96ef-b11aa4cb9e3d(a)11g2000yqr.googlegroups.com>...

> The most likely explanation is that you process the raw,
> uncalibrated data in matlab, whereas the other package
> uses additional calibration information.

The time signals are exactly identical in PAK and in Matlab, as is to be seen here:
http://www.JohannesBuechler.de/TimeSignal_PAKvsMatlab.bmp
(the upload will be done tonight from my home computer)

As you can see the numerical values are identical up to at least 0.1 mPa... This proofs that the export has already applied all correction/calibration/whatever factors. So please, take this as given.

The problem however lies somewhere in Matlab.

In the meantime Mr Kaeferstein (author of http://www.mathworks.com/matlabcentral/fileexchange/2251-campbell ) gave me some possible reasons for a wrong scaling. The most striking one was that the result of FFT is not scaled in Matlab at all. After dividing the result by nfft/2 I have roughly the right Levels now:
http://www.JohannesBuechler.de/Campbell_PAKvsMatlab_v4.bmp (tonight...)

There is still a difference of approx. 5.6 dB though which I can not explain. I don't resample and I have window length = fs. Also:

1.) hanning window is compensated through the 50% overlap
2.) peak vs. RMS is chosen alike in PAK and Matlab: In PAK one can select in the FFT settings, in Matlab I have devided the sound pressure by sqrt(2):
L_p = 20*log10(abs(B)/(sqrt(2)*p0)); % RMS scaling

So these two points can not be the reason for it.

Any more ideas?