[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for waterfall plot function

From: Shai Ayal
Subject: Re: Looking for waterfall plot function
Date: Wed, 10 Aug 2005 15:36:49 +0300
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

I'm not sure if you hit the wall.

I have no experience with the patch command in octave (I think it is from octave-forge), so someone else will have to help you on that.

If you comment it out, you'll get a waterfall plot, but with no "depth", i.e. lines to the front won't obscure lines behind. If this is good enough for you, you've passed the wall. If not, I think gnuplot has the ability to produce output as you desire, but you'll have to work with it directly.


Melvyn Poore wrote:
Well, I¹ve hit a brick wall.  I¹ve included the commented m file here.  I¹d
be very grateful if someone has a few moments to look at it.

Thanks in advance,


function yy=waterfspec(signal, start, steps, N, fS, clippingpoint,
% waterfspec( signal, start, steps, N, fS, clippingpoint, baseplane)
% shows short-time spectra of signal, starting
% at k=start, with increments of STEP with N-point FFT
% dynamic range from -baseplane in dB up to 20*log(clippingpoint)
% in dB versus time axis
% 18/9/98 J. Schattschneider
% 14/10/2000 U. Zoelner
  echo off;
if nargin<7, baseplane=-100; end
if nargin<6, clippingpoint=0; end
if nargin<5, fS=44100; end
if nargin<4, N=1024; end           % default FFT window length
if nargin<3, steps=round(length(signal)/25); end
if nargin<2, start=0; end

windoo=blackman(N);          % window - default
windoo=windoo*N/sum(windoo); % scaling
% Calculation of number spectra nos
if nos>rest/steps,
% vectors for 3D representation
x = linspace(0, fS/1000, N+1);

% computation of spectra and visual representation
for i=1:1:nos,
% spek1=abs(fft(windoo.*signal(1+start+i*steps:start+N+i*steps)))./(N)/0.5;
 spek=[-200 ; spek1(1:N)];
 if i==1
  echo on;
   % here we see size(spek)=1025 1, whereas size(x) & size(y)=1 1025
  echo off;
  plot3(x(1:N/2), y(1:N/2), spek(1:N/2), "k");
  % set doesn't turn up in help
  %set(p, "Linewidth", 0.1);

 % matlab's patch takes more parameters than octave's patch
 % pp=patch(x(1:N/2), y(1:N/2), spek(1:N/2), "w", "Visible", "on");
 % patch wants spek to be transposed, but it doesn't plot,
 % although AquaTerm appears to be updating on a regular basis.
 % I let it run for half an hour.
 patch(x(1:N/2), y(1:N/2), spek(1:N/2), "w");

 % set(pp, "Linewidth", 0.1);
%set(gca, "DrawMode","fast");
axis([-0.3 fS/2000+0.3 0 nos baseplane-10 0]);
%set(gca,"Ydir", "reverse");

On 09.08.2005 13:30 Uhr, "Shai Ayal" <address@hidden> wrote:


octave's plot function does not return any value, so the variable p is
undefined. Matlab returns the handles of the lines drawn. Octave does not
have handle graphics.

So, try deleting all references to p later on in the file. It might work,
although produce uglier results.


Melvyn Poore wrote:

Does anyone know where I can find a working waterfall plot function?

I found one in the DAFX (ed. Zölzer, Wiley 2002) book, but I can¹t for
the life of me get it to work.  It¹s written for MatLab, so I guess
there are some differences.

I get the following error:
error: value on right hand side of assignment is undefined
error: evaluating assignment expression near line 46, column 4

Line 46 is:
   p=plot3(x(1:N/2), y(1:N/2), spek(1:N/2), "k");

All the variables are defined and populated, which doesn¹t preclude an
undefined value coming out in the wash: but I can¹t see any error in the
expression.  I need a hand from someone more experienced, please!

I can post the whole function if necessary.



Melvyn Poore
Kantelberg 8
53773 Hennef

Tel: +49 (2248) 446907
Mobile: +49 (173) 511 9336
email: address@hidden

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

Shai Ayal, Ph.D.
Head of Research
BioControl Medical BCM
3 Geron St.
Yehud 56100
Tel:  + 972 3 6322 126 ext 223
Fax:  + 972 3 6322 125
email: address@hidden

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]