Documentation for delay2time (SPASS).

Conversion of delays to times for a non uniform signal


Description

The function delay2time converts delays to times for a non uniform signal. Useful in particular for plotting signals.

Usage

time = delay2time(delay)
time = delay2time(delay,t0)

Arguments

time Times. Row vector.
t0 Initial time (of the first delay). Scalar. Optional.

Values

time Times. Row vector.

See Also

Example

  f = 1;           % signal frequency
  t = 10/f;        % signal duration
  t0 = 1.;         % initial time
  nbsamples = 10;  % number of samples
  times = t0+t*random('unif',0,1,1,nbsamples);
  times=sort(times); % time samples

  delay=time2delay(times,t0); % delay samples
  a = 0.45;        % signal amplitude

  ampl = a*sin(2*pi*f*times)+a*sin(4*2*pi*f*times)+0.9;   % amplitudes
  nu = nuinit(ampl,delay,t0);
  plot(delay2time(nu.delay),nu.ampl);