Discussion:
[SoX-devel] spectrogram
Markus Glugla
2014-10-31 18:19:56 UTC
Permalink
Hello,

I am new on this list and I have a question.

The source code for the spectrogram includes the following line:

double dBFS = 10 * log10 ( p > magnitudes [ i ] * p-> block_norm ) ;

I'm not sure, but the product p-> magnitudes [ i ] * p-> block_norm
describes an amplitude spectrum and not a power spectrum, right?

If so, then it should be 20*log10(...) instead 10*log10(...) with an
output displayed in dBFS.

I would be grateful for an explanation, thank you.

Markus Glugla




------------------------------------------------------------------------------
Rob Sykes
2014-11-01 11:19:23 UTC
Permalink
Post by Markus Glugla
If so, then it should be 20*log10(...) instead 10*log10(...) with an
output displayed in dBFS.
I would be grateful for an explanation, thank you.
Hello Markus, this is because the magnitudes variable is not so well-named: it actually contains magnitude squared.

Cheers, Rob
Markus Glugla
2014-11-01 11:53:17 UTC
Permalink
Hello Rob,
Post by Rob Sykes
it actually contains magnitude squared.
Yes, thank you for the hint which opened my eyes . I have found the
place in the source code: p->magnitudes[i] += sqr(...).

Thanks to you, Rob.

Regards, Markus.





------------------------------------------------------------------------------
Loading...