Signal Processing - Maple Help

SignalProcessing Improvements in Maple 2024

The SignalProcessing package has been expanded with new and updated commands.

 > with( SignalProcessing ):

ResponseSpectrum

 • The new SignalProcessing:-ResponseSpectrum command is used to plot the response of a structure or system to varying frequencies of ground motion or input excitation. A response spectrum is commonly used in structural and earthquake engineering to assess the potential response of a structure to seismic events.
 • Consider the following vibration data from the El Centro earthquake of 1940:
 > file := FileTools:-JoinPath( [ kernelopts( 'datadir' ), "datasets", "el-centro_NS.txt" ] ):
 > data := ImportMatrix( file, 'delimiter' = " " );
  (1)
 > dataplot( data[..,1], data[..,2], 'style' = 'line', 'color' = 'burgundy', 'title' = "El Centro Earthquake Vibration Data", 'size' = [800,400] );
 • For appropriate choices of parameters, we can obtain a collection of charts and data containers:
 > R := ResponseSpectrum( data, 0.02, 0.01, 5, 'zeta' = 0.02, 'beta' = 0.25, 'gamma' = 0.5, 'output' = 'record' ):
 • For example, we can view the plot of acceleration:
 > R['absoluteaccelerationplot'];

IntegrateData and IntegrateData2D

 • The SignalProcessing:-IntegrateData command has been updated to include an option initial to specify the initial area and output option running to return running totals. For example, suppose we want to determine position from velocity:
 > t1 := 0.0:
 > t2 := 2.0:
 > n := 100:
 > ( dt, T, V ) := GenerateSignal( t * exp(-t/2) * sin(2*t*Pi), t = t1 .. t2, n, 'output' = ['timestep','times','signal'] );
  (2)
 > x0 := 1.0:
 > X := IntegrateData( V, 'step' = dt, 'initial' = x0, 'method' = 'trapezoid', 'output' = 'running' );
  (3)
 > dataplot( T, [ V, X ], 'color' = ['darkgreen','blue'], 'labels' = ["time",""], 'legend' = ['velocity','position'], 'style' = 'line', 'size' = [800,400] );
 • The SignalProcessing:-IntegrateData and SignalProcessing:-IntegrateData2D commands have also been updated to be units aware. For example:
 > T := Vector( [1,2,3], 'datatype' = 'float[8]' ) * Unit('s');
 ${T}{≔}\left[\begin{array}{c}{1.}{}⟦{s}⟧\\ {2.}{}⟦{s}⟧\\ {3.}{}⟦{s}⟧\end{array}\right]$ (4)
 > V := Vector( [1,4,9], 'datatype' = 'float[8]' ) * Unit('m/s');
 ${V}{≔}\left[\begin{array}{c}{1.}{}⟦\frac{{m}}{{s}}⟧\\ {4.}{}⟦\frac{{m}}{{s}}⟧\\ {9.}{}⟦\frac{{m}}{{s}}⟧\end{array}\right]$ (5)
 > IntegrateData( V, 'step' = 1.0 * Unit('s') );
 ${9.}{}⟦{m}⟧$ (6)
 > IntegrateData( T, V );
 ${9.}{}⟦{m}⟧$ (7)
 > X := IntegrateData( T, V, 'output' = 'running' );
 ${X}{≔}\left[\begin{array}{c}{0.}\\ {2.50000000000000}{}⟦{m}⟧\\ {9.}{}⟦{m}⟧\end{array}\right]$ (8)

FindPeakPoints

 • The heavy computations involved in the SignalProcessing:-FindPeakPoints command have been moved to external code, resulting in a substantial increase in speed. For example:
 > n := 25000:
 > A := Vector( n, i -> 1 - i * (-1)^(i+1), 'datatype' = 'float[8]' ):
 > R := CodeTools:-Usage( FindPeakPoints( A, 'output' = 'record' ), 'iterations' = 10 ):
 memory used=5.60MiB, alloc change=87.32MiB, cpu time=35.10ms, real time=30.60ms, gc time=9.24ms
 • The CPU time required in Maple 2024 is about 100 times smaller than in Maple 2023.
 • Two new output options, extremes and extremeindices, have also been added to the command:
 > f := sin(t) + 1/2 * cos(3*t):
 > a := 0:
 > b := 2 * Pi:
 > n := 100:
 > ( T, X ) := GenerateSignal( f, t = a .. b, n, 'output' = ['times','signal'] );
  (9)
 > E := FindPeakPoints( T, X, 'output ' = 'extremes' );
 ${E}{≔}\left[\begin{array}{cc}{0.}& {0.500000000000000}\\ {0.253866073017357}& {0.613015006233614}\\ {0.888531255560750}& {0.331728739964295}\\ {2.03092858413886}& {1.38695812292269}\\ {3.36372546747998}& {-0.613337080157934}\\ {4.06185716827771}& {-0.331577874022796}\\ {5.14078797860148}& {-1.38937848216177}\\ {6.28318530717959}& {0.500000000000000}\end{array}\right]$ (10)
 > p := dataplot( T, X, 'style' = 'line', 'legend' = "Signal", 'color' = 'firebrick' ):
 > q := dataplot( E[..,1], E[..,2], 'style' = 'line', 'legend' = "Extremes", 'color' = 'blue' ):
 > plots:-display( p, q, 'size' = [800,400] );