Hello,
Is there some examples for using the KwaveArray ?
Best Regards,
HN
Hello,
Is there some examples for using the KwaveArray ?
Best Regards,
HN
Yes - there are several examples in the included documentation under “modelling transducer arrays”.
Thank you for your response !
I want to modelise a 2D Probe that contain elements and an inter-space element in 3D, and I think the best way is to use KwaveArray class! But I did not find the function that would allow me to declare the number of elements with an inter-space and their position. Or do I have to declare each element manually?
Best Regards,
HN
Hi HN,
Yes at the moment you need to define them manually. The Modelling A Linear Array Transducer Example shows one way to do this.
Brad.
Hi everyone,
Is there a way for me to get grid points form part of the specified element. As for example_at_array_as_sensor.m, I got a sensor_data array of size 6748 by 1207. There is 20 elements.
But, how could I tell which transducer these 6748 time series belong to.
I find a property named 'getElementBinaryMask' may be work. But when I run it in the following way, I get an error 'Method, attribute, or field 'getElementBinaryMask' of class 'kWaveArray' not recognized.'.
mask2 = karray.getElementBinaryMask(kgrid, 1); % grid points form part of the specified element
Does anyone know how to solve this problem?
Hi everyone,
I have a problem with the kspaceFirstOrder2D.
error message is 'source.p_mask must be a binary grid with at least one element set to 1.
I want to find acoustic fiend arising from array used kwavearray class, however, I found above error messasge.
Here is my code.
karray = kWaveArray;
% define the grid parameters
pml_size = 20;
Nx = 552 - 2 * pml_size; % [grid points]
Ny = 552 - 2 * pml_size; % [grid points]
dx = 1e-3; % [m]
dy = 1e-3; % [m]
% create the computational grid
kgrid = kWaveGrid(Nx, dx, Ny, dy);
%% ALPHA COEFF
medium.alpha_coeff = 0.02 * ones(Nx, Ny); % [dB/(MHz^y cm)] WATER
medium.alpha_power = 1.5;
%% SPEED
medium.sound_speed = 1500 * ones(Nx, Ny); % WATER default fill! [m/s]
% %skull
%% DENSITY
medium.density = 1000 * ones(Nx, Ny); % WATER default fill [kg/m^3]
freq = 200*10^3; % [Hz]
amp = 0.3e6; % 0.53[MPa]
radius = 10e-3; % [m]
diameter = 15e-3; % [m]
focus_pos = [Nx/2, Ny/2]; % [m]
% add arc shaped element
elem_pos = [Nx/10, Ny/2]; % [m]
karray.addArcElement(elem_pos, radius, diameter, focus_pos);
% add arc shaped element
elem_pos = [Nx/10, Ny/2.5]; % [m]
karray.addArcElement(elem_pos, radius, diameter, focus_pos);
% add arc shaped element
elem_pos = [Nx/10, Ny/3.0]; % [m]
karray.addArcElement(elem_pos, radius, diameter, focus_pos);
source.p_mask = karray.getArrayBinaryMask(kgrid);
display_mask = source.p_mask;
% calculate the time step using an integer number of points per period
ppw = 100; % points per wavelength
cfl = 0.1; % cfl number
ppp = 41; % points per period
T = 1 / freq; % period [s]
dt = 4e-8; % time step [s]
% calculate the number of time steps to reach steady state
t_end = 40.0575e-5;
Nt = round(t_end / dt);
% create the time array
kgrid.setTime(Nt, dt);
% define the input signal
source.p = createCWSignals(kgrid.t_array, freq, [amp, amp, amp], 0);
sensor.mask = ones(Nx, Ny);
sensor.record = {'p', 'p_max_all'};
% record the last 3 cycles in steady state
num_periods = 15;
T_points = round(num_periods * T ./ kgrid.dt);
sensor.record_start_index = Nt - T_points + 1;
% set the input arguements
input_args = {'PMLInside', false,'PlotLayout', true, 'PlotPML', false, 'DisplayMask', display_mask, 'PlotScale', [-1, 1] * amp};
% run the acoustic simulation
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});
Thanks
Hi Jinhyuk Kim,
In kWaveArray
, the element positions must be set in physical space (not grid space). So, in your example, there are no elements within the grid, so the mask ends up being zero (hence the error message).
Brad
Thanks, Bradley!
I have to adjust the position of the ultrasound transducer, right?
I'll try and research successfully!
Hi Bradley,
I'm simulating a disc element using karray.addDiscElement, but when I draw the 3D plot of this element, it seems the shape of the element is not a disc, it looks like it's rectangle, is this normal?
Cordially,
You must log in to post.