I'll do these patches a little at a time.
Here is a patch to show a complex spectrogram with the negative frequencies flipped down. I've also attached a modified version of the spectrogram_demo.py that creates the two signals as complex exponentials so they are only in one half of the spectrum (long signal positive, short signal negative).
Basically, if the input signal is complex then the whole spectrogram is shown. If the input is real then just the positive frequencies are shown.
Next I'll work on the following as discussed.
Thanks
Greg
On 10/6/06, John Hunter <[EMAIL PROTECTED]> wrote:
>>>>> "Greg" == Greg Willden <[EMAIL PROTECTED]> writes:
Greg> c) Modify specgram so that if it
Greg> receives an array as the window parameter it checks its
Greg> length and then applies it as a window. If the window
Greg> parameter is not an array then it treats it as a function
Greg> (current behaviour)
This is fine -- I suggest using the matplotlib.cookbook.iterable
function or the python builtin callable function to do the check.
Whatever changes you make for specgram should also be ported into psd,
csd and cohere.
--
Linux. Because rebooting is for adding hardware.
#!/usr/bin/env python from pylab import * dt = 0.0005 t = arange(0.0, 20.0, dt) Fs = int(1.0/dt) # the sampling frequency
s1 = exp(2j*pi*100*t) #Sinusoid at positive frequency s2 = 2*exp(-2j*pi*400*t) #Sinusoid at negative frequency # create a transient "chirp" mask = where(logical_and(t>10, t<12), 1.0, 0.0) s2 = s2 * mask # add some noise into the mix nse = 0.01*randn(len(t)) x = s1 + s2 + nse # the signal NFFT = 1024 # the length of the windowing segments # Pxx is the segments x freqs array of instantaneous power, freqs is # the frequency vector, bins are the centers of the time bins in which # the power is computed, and im is the matplotlib.image.AxesImage # instance Pxx, freqs, bins, im = specgram(x, NFFT=NFFT, Fs=Fs, noverlap=900) #colorbar() show()
complex-specgram-patch
Description: Binary data
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel