Thanks Eric for pointing out this. However i've found that psd and
specgram plot 10*log10*(Pxx/max(Pxx)), so i'll have a range from 0 db
down. 
Anyway, what do you mean by "should not be axes method"?
Do you mean using the array output of specgram and psd and plotting that
result by myself?

Cheers

Davide
On Tue, 2009-07-21 at 09:12 -1000, Eric Firing wrote:
> davide lasagna wrote:
> > Hello everybody,
> > this is my first post in this list. 
> > 
> > I'm plotting a spectrogram with
> > 
> > Pxx, freqs, bins, im = specgram(y, nfft=256, f_sampling=12000)
> > 
> > and i want to add a colorbar with
> > 
> > colorbar()
> > 
> > 
> > The problem is that the color scale seems to be wrong with respect to
> > the data in Pxx, i.e. Pxx is of the order of 1e-2 while in the colorbar
> > i have tick values spanning from -20 to -180. What is the problem??
> 
> specgram and psd plot power in decibels: 10*log10(Pxx).
> 
> Because they involve heavy computation and application-specific choices, 
> like the decibel scale, they really should not be axes methods.
> 
> You can make a function plot the spectrogram however you like by looking 
> at the source code in the Axes.specgram method (the pyplot specgram 
> function is just a thin wrapper for this method), which is using 
> mlab.specgram to do the calculation and is then just scaling and plotting.
> 
> Eric
> 
> 
> > 
> > Thanks in advance!
> > 
> > 
> > Davide
> > 
> > 
> > ------------------------------------------------------------------------------
> > Enter the BlackBerry Developer Challenge  
> > This is your chance to win up to $100,000 in prizes! For a limited time, 
> > vendors submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See full prize 
> >  
> > details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 


------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to