[Bug 787238] Spectrum plugin shows magnitudes that are way too small

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Sep 15 13:29:57 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=787238

--- Comment #3 from r.felgenhauer at wenzel-elektronik.de ---
I looked into this issue and noticed the following:

In
https://github.com/GStreamer/gst-plugins-good/blob/master/gst/spectrum/gstspectrum.c#L782
the magnitude for each band gets calculated by ((real part)^2 + (imaginary
part)^2) / (fft length^2). The part over the fraction is the squared absolute
value of the complex number. Don't we just want the absolute value? If I change
this:
  val /= nfft * nfft;
to this:
  val = sqrt(val);
  val /= nfft;
the resulting magnitude is at least linearly dependent of the input magnitude.
Since the values are smaller than 1, calculating the sqrt makes them bigger.
However it's still smaller than the input magnitude by a factor that was about
3.9 for all tests with 16, 32, ..., 1024, 2048 bands and about 5.8 for all
tests with 4096 bands. Very strange.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list