doc PulseDecomp

Documentation of the PulseDecomp function.

helpFun('PulseDecomp')
 Pulse decomposition of a velocity time history

 [PULSETH,RESTH,TP,WAVSCALE,WAVCOEFS]=PulseDecomp(DT,XGT,WNAME,TPMIN,...
     TPMAX,NSCALES)

 Description
     This function decomposes an input velocity time history record into a
     pulse motion and a residual motion. The shape of the pulse depends on
     the value of the WNAME parameter. To obtain the velocity time history
     of a given acceleration record use the command:
     PARAM=OpenSeismoMatlab(DT,XGTT,'TIMEHIST',BASELINESW)
     To extract more than one pulse wavelets from a velocity time history
     (let's say N), apply this function repetitively N times where at each
     time (except for the first) this function is applied to the residual
     motion of the previous time:
     [PULSETH1,RESTH1,~,~,~]=PulseDecomp(DT,XGT,WNAME,TPMIN,TPMAX,...
         NSCALES)
     [PULSETH2,RESTH2,~,~,~]=PulseDecomp(DT,RESTH1,WNAME,TPMIN,TPMAX,...
         NSCALES)
     etc.

 Input parameters
     DT [double(1 x 1)] is the time step of the input velocity time
         history XGT.
     XGT [double(1:numsteps x 1)] is the input velocity time history.
         numsteps is the length of the input velocity time history.
     WNAME [char(1 x :inf)] is the wavelet family short name to be used
         for the decomposition of the velocity time history. See the
         Matlab function waveinfo.m for more details.
     TPMIN [double(1 x 1)] is the minimum pulse period to be considered
         for the continuous 1-D wavelet transform of XGT
     TPMAX [double(1 x 1)] is the maximum pulse period to be considered
         for the continuous 1-D wavelet transform of XGT
     NSCALES [double(1 x 1)] is the number of pulse period values between
         TPMIN and TPMAX to be considered for the continuous 1-D wavelet
         transform of XGT

 Output parameters
     PULSETH [double(1:numsteps x 1)] is the velocity time history of the
         pulse contained in the input velocity time history. numsteps is
         the length of the input velocity time history.
     RESTH [double(1:numsteps x 1)] is the velocity time history of the
         residual motion after subtracting the time history of the pulse
         from the input velocity time history. numsteps is the length of
         the input velocity time history.
     TP [double(1 x 1)] is the period of the pulse which is extracted from
         the input velocity time history.
     WAVSCALE [double(1 x 1)] is the scale at which the largest wavelet
         was found.
     WAVCOEFS [double(1 x 1)] is the coefficient for the extracted
         wavelet. 

 Example
     rng(0)
     % Duration in seconds
     duration = 10;
     % Time step
     dt = 0.01;
     % Time vector
     t = linspace(0, duration, duration /dt)';
     % Number of sinusoidal components
     num_sin_components = 3;
     % Generate a random seismic signal using a combination of sinusoids
     xgt = zeros(length(t),1);
     for i = 1:num_sin_components
         % Generate the sinusoidal component
         s = rand * sin(2 * pi * 0.5*rand * t + rand);
         % Add the component to the seismic signal
         xgt = xgt + s;
     end
     % Setup wavelet parameters
     wname = 'db4';
     TpMin = 0.25;
     TpMax = 15;
     nScales = 50;
     % Apply pulse decomposition
     [pulseTH,resTH,Tp,wavScale,wavCoef] = ...
         PulseDecomp(dt,xgt,wname,TpMin,TpMax,nScales);
     % Plot the results
     np = length(xgt);
     time = dt:dt:dt*np;
     fig = figure();
     subplot(3,1,1)
     plot(time, xgt, '-k')
     legend('Original ground motion','location','northwest')
     ylabel('Velocity');
     set(gca, 'xticklabel', [])
     subplot(3,1,2)
     plot(time, pulseTH, '-r')
     legend('Extracted pulse','location','northwest')
     ylabel('Velocity');
     set(gca, 'xticklabel', [])
     subplot(3,1,3)
     plot(time, resTH , '-k')
     legend('Residual ground motion','location','northwest')
     hy = ylabel('Velocity');
     hx = xlabel('Time [s]');

__________________________________________________________________________
 Copyright (c) 2018-2023
     George Papazafeiropoulos
     Major, Infrastructure Engineer, Hellenic Air Force
     Civil Engineer, M.Sc., Ph.D.
     Email: gpapazafeiropoulos@yahoo.gr
 _________________________________________________________________________