I would like to ask about simulating bubble defects when using sinusoidal filtering to display values that exceed the maximum variable allowed by the program. Please ask where the error occurred
% create the computational grid
Nx = 110; % number of grid points in the x (row) direction
Ny = 110; % number of grid points in the y (column) direction
dx = 10e-3/Nx; % grid point spacing in the x direction [m]
dy = dx; % grid point spacing in the y direction [m]
kgrid = kWaveGrid(Nx, dx, Ny, dy);
% create initial pressure distribution using makeDisc
disc_x_pos = 55; % [grid points]
disc_y_pos = 55; % [grid points]
disc_radius = 10; % [grid points]
disc = makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);
% define the properties of the propagation medium
medium.sound_speed(disc == 1) = 340 ; % [m/s]
medium.density(disc == 1) = 1290 ; % [kg/m^3]%
% create the time array
kgrid.makeTime(medium.sound_speed);
% define a single source point
source.p_mask = zeros(Nx, Ny);
source.p_mask(29 , 40) = 1;
% define a time varying sinusoidal source
source_freq =2.5e6; % [Hz]
source_mag = 10; % [Pa]
source.p = source_mag * sin(2 * pi * source_freq * kgrid.t_array);
% filter the source to remove high frequencies not supported by the grid
source.p = filterTimeSeries(kgrid, medium, source.p);