Re: Waterfall Plot Plea for Help
- To: mathgroup at smc.vnet.net
- Subject: [mg38933] Re: Waterfall Plot Plea for Help
- From: christopherpurcell <christopherpurcell at mac.com>
- Date: Mon, 20 Jan 2003 00:45:50 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Raster would be a good starting point for waterfall plots. records=50; samples=128; w=2. Pi 5; (* fundamental angular frequency of made up data *) Clear[f]; f[t_]:=Cos[w t]+Cos[3 w t]/3+Cos[5 w t]/5+Random[Real,t]/60.; (* some harmonic data with noise added *) samplerate=100; (* sampling rate Hz *) data=Partition[Table[f[i/samplerate],{i,0,samples*records-1}],samples]; (* time series data partitioned into records.We could have windowed here if desired *) (* Plot the time series data next*) ListPlot[Flatten[data],PlotJoined->True,Frame->True]; (* Then make a list of power spectra, one of each record: *) powerspectra=Map[Take[#,samples/2]&,Map[Abs[Fourier[#]]&,data]]; (* Only half the spectra is taken to remove the folded over portion *) (* here is a simple "frozen" waterfall plot *) Show[Graphics[Raster[powerspectra],AspectRatio->records/samples,Frame- >True]]; You could then add windowing to the data records and a proper frequency scale in Hz, and insert Logs and normalization to get the intensity in greyscale or color keyed to a decibel scale. Next you can animate this, so you see the waterfall growing in height on your screen, using the animation ideas discussed in this forum over the last year or so, and you would have what you seek. >From : Bruce Detterich < bruce.detterich at ieee.org > >Date : Sun, 19 Jan 2003 00:33:12 -0500 (EST) >Searches of past discussion yielded a couple of threads on the topic of >waterfall plots a couple of years ago, but nothing too helpful. >I'm just looking for hints as to which fundamental plot command to start >from. Christopher Purcell DRDC-Atlantic, 9 Grove St., PO Box 1012, Dartmouth, NS Canada B2Y 3Z7 Tel: 902-426-3100-x389 Fax: 902-426-9654 chris.purcell at drdc-rddc.gc.ca