Le lundi 19 septembre 2011 à 19:54 +0200, Klonuo Umom a écrit :
> I want to use kaiser window that's part of numpy for drawing spectrogram
> 
> specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
>            window=mlab.window_hanning, noverlap=128,
>            cmap=None, xextent=None, pad_to=None, sides='default',
>            scale_by_freq=None, **kwargs)
> 
> *window*: callable or ndarray
>     A function or a vector of length *NFFT*. To create window
>     vectors see :func:`window_hanning`, :func:`window_none`,
>     :func:`numpy.blackman`, :func:`numpy.hamming`,
>     :func:`numpy.bartlett`, :func:`scipy.signal`,
>     :func:`scipy.signal.get_window`, etc. The default is
>     :func:`window_hanning`.  If a function is passed as the
>     argument, it must take a data segment as an argument and
>     return the windowed version of the segment.
> 
> So I tried:
> 
> Pxx, freqs, bins, im = specgram(x, NFFT=1024, Fs=fs, window=kaiser,
> noverlap=2)
> TypeError: kaiser() takes exactly 2 arguments (1 given)

Does the following solve your problem ?
NFFT = 1024
win = kaiser(NFFT,8) # 8 is the shpe parameter of the window
Pxx, freqs, bins, im = specgram(x, NFFT=1024, Fs=fs, window=win, noverlap=2)


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to