Excitation functions


create_1d_raised_cosine

 create_1d_raised_cosine (duration:float, start_time:float,
                          end_time:float, amplitude:float,
                          sample_rate:float)

Create a 1D raised cosine excitation with time parameters in seconds.

Type Details
duration float Total duration of the excitation (in seconds).
start_time float Start time of the excitation (in seconds).
end_time float End time of the excitation (in seconds).
amplitude float Amplitude of the excitation.
sample_rate float Sample rate (samples per second).
Returns ndarray The excitation signal.
rc = create_1d_raised_cosine(
    1,
    0.01,
    0.05,
    1,
    44100,
)

plt.plot(rc)


create_raised_cosine

 create_raised_cosine (Nx, Ny, h, ctr, epsilon, wid)

*Create a raised cosine function on a 2D grid.

Parameters: Nx (int): Number of grid points in the x-direction. Ny (int): Number of grid points in the y-direction. h (float): Grid spacing. ctr (tuple): Center of the raised cosine (x, y). epsilon (float): Scaling parameter. wid (float): Width of the cosine.

Returns: np.ndarray: Flattened raised cosine array.*

from matplotlib import pyplot as plt
# Example usage
Nx, Ny = 25, 21  # Grid dimensions
h = 0.0438  # Grid spacing
ctr = (0.5, 0.5)  # Center of the raised cosine
epsilon = 1.2000  # Scaling parameter
wid = 0.3  # Width of the cosine

rc, X, Y, dist, distx, disty = create_raised_cosine(
    Nx,
    Ny,
    h,
    ctr,
    epsilon,
    wid,
)

plt.imshow(rc, cmap="gray", origin="lower")


create_pluck_modal

 create_pluck_modal (lambdas:numpy.ndarray, pluck_position:float=0.28,
                     initial_deflection:float=0.03,
                     string_length:float=1.0)

Create a pluck excitation for a string with a given length and pluck position. The pluck is modeled in the modal domain.

Type Default Details
lambdas ndarray eigenvalues of the Laplacian operator
pluck_position float 0.28 position of pluck on the string in meters
initial_deflection float 0.03 initial deflection of the string in meters
string_length float 1.0 total length of the string in meters
Returns ndarray The pluck excitation in the modal domain.