Саня Девайкин | 3 Jun 06:28 2009
Picon

How to resize(compress) spectrum

Hi!
I need to resize spectrum from some random size to 800. For example, I have to draw the whole file on the widget
with the width 800px, but don't know how to compress spectrum to fit it.

Thank you!
David García Garzón | 3 Jun 12:02 2009
X-Face

Re: How to resize(compress) spectrum

The spectrum size depends on the audio size, we normally do zero padding (plus 
windowing) to get higher spectral resolution so, if the final goal is to 
display (not analysing) just take smaller windows or don't do zero padding. Or 
if you still need higher resolution for analysis, do a different processing 
branch for visualizing. But still I don't fully understand your motivation to 
get smaller spectrums. SpectrumView shows the spectrum to whatever size just 
by compressing the line drawing. If you don't mind to be aproximate you can 
also get the bin with nearest frequency to the frequency that corresponds to 
the pixel or being more acurate and do a pondered mean of the nearer n bins.

A Dimecres, 3 de juny de 2009 06:28:16, Саня Девайкин va escriure:
> Hi!
> I need to resize spectrum from some random size to 800. For example, I have
> to draw the whole file on the widget with the width 800px, but don't know
> how to compress spectrum to fit it.
>
> Thank you!
>
>
> _______________________________________________
> CLAM mailing list
> CLAM@...
> http://clam.iua.upf.edu

--

-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot edu
http://www.iua.upf.edu/~dgarcia
Leo Wang | 30 Jun 17:25 2009
Picon

compile stand alone application using CLAM library

Hello All,

I would like to compile a stand alone application using CLAM library on Ubuntu 8.10. CLAM library and tools were installed by apt-get. There are some approaches I followed but have some header file problem though I am not familiar with scons. Since it is recommended by document, I am using it.

1. copied an example file from CLAM source code:

FileInfo_example.cxx

2. rename it to
main.cxx

3. copy the minimal Sconstruct file from wiki
http://clam-project.org/wiki/Minimal_SConstruct_to_build_with_CLAM_and_Qt4

then I type

scons clam_prefix=/usr

(in ubuntu clam seems to be installed at /usr/include and /usr/lib)

It seems scons didnot sort the head file links for CLAM, we have error:
.............
g++ -o main.o -c -g -O3 -Wall -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED -DCLAM_FLOAT -DUSE_PTHREADS=1 -DUSE_XERCES=1 -DCLAM_USE_XML -DUSE_LADSPA=1 -DUSE_SNDFILE=1 -DUSE_OGGVORBIS=1 -DWITH_VORBIS=1 -DUSE_MAD=1 -DWITH_MAD=1 -DUSE_ID3=1 -DUSE_ALSA=1 -DUSE_JACK=1 -DUSE_PORTAUDIO=1 -DUSE_FFTW3=1 -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/local/include -I/usr/include/alsa main.cxx
main.cxx:29:25: error: AudioFile.hxx: No such file or directory
main.cxx: In function ‘int main(int, char**)’:

But the /usr/include/CLAM/AudioFile.hxx is in my machine. And from the output it seems the scons did not add "-I/usr/include/CLAM". So I am confused, do we need to customise the sconstruct file from the wiki?

Any help will be appreciated!

regards

Yonghao



_______________________________________________
CLAM mailing list
CLAM@...
http://clam.iua.upf.edu
David García Garzón | 30 Jun 17:52 2009

Re: compile stand alone application using CLAM library

Yeep, you are rigth. The real problem is on the example. That header should be 
included as <CLAM/AudioFile.hxx> which is the suggested include style for 
applications using CLAM. Although the costumization you did should work.

We should update all the examples to use that convention so that when somebody 
thake them out to their projects they still work. 

On Tuesday 30 June 2009 17:25:39 Leo Wang wrote:
> Hello All,
>
> I would like to compile a stand alone application using CLAM library on
> Ubuntu 8.10. CLAM library and tools were installed by apt-get. There are
> some approaches I followed but have some header file problem though I am
> not familiar with scons. Since it is recommended by document, I am using
> it.
>
> 1. copied an example file from CLAM source code:
>
> FileInfo_example.cxx
>
> 2. rename it to
> main.cxx
>
> 3. copy the minimal Sconstruct file from wiki
> http://clam-project.org/wiki/Minimal_SConstruct_to_build_with_CLAM_and_Qt4
>
> then I type
>
> scons clam_prefix=/usr
>
> (in ubuntu clam seems to be installed at /usr/include and /usr/lib)
>
> It seems scons didnot sort the head file links for CLAM, we have error:
> .............
> g++ -o main.o -c -g -O3 -Wall -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED
> -DCLAM_FLOAT -DUSE_PTHREADS=1 -DUSE_XERCES=1 -DCLAM_USE_XML -DUSE_LADSPA=1
> -DUSE_SNDFILE=1 -DUSE_OGGVORBIS=1 -DWITH_VORBIS=1 -DUSE_MAD=1 -DWITH_MAD=1
> -DUSE_ID3=1 -DUSE_ALSA=1 -DUSE_JACK=1 -DUSE_PORTAUDIO=1 -DUSE_FFTW3=1
> -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui
> -I/usr/local/include -I/usr/include/alsa main.cxx main.cxx:29:25: error:
> AudioFile.hxx: No such file or directory
> main.cxx: In function ‘int main(int, char**)’:
>
> But the /usr/include/CLAM/AudioFile.hxx is in my machine. And from the
> output it seems the scons did not add "-I/usr/include/CLAM". So I am
> confused, do we need to customise the sconstruct file from the wiki?
>
> Any help will be appreciated!
>
> regards
>
> Yonghao

Gmane