[gst-devel] Strange results from spectrum analyser

Ikke eikke at eikke.com
Mon Mar 28 07:25:55 CEST 2005


Hija,

I'm quite new to GStreamer, and started to play around with it lately
(in code) to get used to it (I'd like to use it in some new project).

One of the thing's I'd need is an FFT transform of input data, and the
spectrum analyser element seems to provide me with this information.
After searching around a little I found this [1] sample code, which
shows a spectral graph of OSS input.

Because I got no microphone attached to my desktop, I decided to replace
the input element with a simple sinesrc, and play around with that a
little, resulting code is attached.

The results surprised me though. When doing a spectral analysis on a
simple sine wave, I expect one peak at the given frequency (not just one
of course, there can be noise and smaller peaks at (n*SINEFREQ), but
well, you get the picture I guess). The result I got was completely
different though... I get some low frequencies, then silence, then a lot
of fuzz all at once. Just compile the code, and play around with some
SINEFREQ values (like 220, 440, 880,...) The results do vary, but none
of them give what I expect them to be.

It could be possible the GTK displaying code is just wrong of course,
I'm no GTK guru at all (still learning)...
Or maybe it's just me, thinking I know what a spectral analysis is, but
being wrong there ;-)

I'm really puzzled, so please help this newbie out :-)

Kind regards,

Ikke
http://www.eikke.com

[1]
http://cvs.freedesktop.org/gstreamer/gst-plugins/gst/spectrum/demo-osssrc.c?rev=1.9&content-type=text%2Fplain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spectrumtest.c
Type: text/x-csrc
Size: 2797 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20050328/c5b03c6d/attachment.c>


More information about the gstreamer-devel mailing list