<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: The focusing problem of phased array in multi-layered biological tissue</title>
		<link>http://www.k-wave.org/forum/topic/the-focusing-problem-of-phased-array-in-multi-layered-biological-tissue</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:30:35 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/the-focusing-problem-of-phased-array-in-multi-layered-biological-tissue" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "The focusing problem of phased array in multi-layered biological tissue"</title>
			<link>http://www.k-wave.org/forum/topic/the-focusing-problem-of-phased-array-in-multi-layered-biological-tissue#post-7214</link>
			<pubDate>Wed, 12 Feb 2020 11:40:55 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7214@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Jack,&#60;/p&#62;
&#60;p&#62;1) All of your tone burst offsets are the same because you have set &#60;code&#62;transducer.element_spacing&#60;/code&#62; to zero.&#60;/p&#62;
&#60;p&#62;2) Certainly k-Wave can transmit and receive ultrasound waves, so I would say so, but I don't know the particulars of what you want to achieve.&#60;/p&#62;
&#60;p&#62;3) Only linear array transducers are supported by the kWaveTransducer class. It's possible to make a source of arbitrary shape, but you will need to define this yourself directly using the source fields, e.g., &#60;code&#62;source.p_mask&#60;/code&#62; and &#60;code&#62;source.p&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jackYANG on "The focusing problem of phased array in multi-layered biological tissue"</title>
			<link>http://www.k-wave.org/forum/topic/the-focusing-problem-of-phased-array-in-multi-layered-biological-tissue#post-7136</link>
			<pubDate>Thu, 28 Nov 2019 12:35:23 +0000</pubDate>
			<dc:creator>jackYANG</dc:creator>
			<guid isPermaLink="false">7136@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Anyone who can help me ?It's a really urgent question for me,help?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jackYANG on "The focusing problem of phased array in multi-layered biological tissue"</title>
			<link>http://www.k-wave.org/forum/topic/the-focusing-problem-of-phased-array-in-multi-layered-biological-tissue#post-7129</link>
			<pubDate>Mon, 18 Nov 2019 11:55:56 +0000</pubDate>
			<dc:creator>jackYANG</dc:creator>
			<guid isPermaLink="false">7129@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,everybody and dear Mr. Bradley e. Treeby,&#60;br /&#62;
     I am a student and my name is jackYANG.Recently, I was doing focus compensation learning in phased array organization based on time reversal algorithm,but now I have some problems.&#60;br /&#62;
(1) I used tone_burst_offset to get the phase of the input signal, but failed, and found that the input signal of each array element was the same.&#60;br /&#62;
(2)I would like to ask if k-wave supports my entire mission, which is to focus the phased array in multiple layers of tissue, and then use the time-reversal algorithm to retrieve the reflected signal and reverse the emission to achieve the focus again.&#60;br /&#62;
(3)Finally, I would like to ask if I can use a concave ring to install a multielement phased array&#60;br /&#62;
Below is the code that I did not add the algorithm to implement the focus, but I got the same input signal without any change.&#60;br /&#62;
I also want to get a three-dimensional distribution of the sound field distribution, do you have a method?&#60;br /&#62;
clear all;&#60;/p&#62;
&#60;p&#62;% simulation design&#60;br /&#62;
% simulation settings&#60;br /&#62;
DATA_CAST = 'single';       % set to 'single' or 'gpuArray-single' to speed up computations&#60;br /&#62;
MASK_PLANE = 'xy';          % set to 'xy' or 'xz' to generate the beam pattern in different planes&#60;br /&#62;
USE_STATISTICS = false;      % set to true to compute the rms or peak beam patterns, set to false to compute the harmonic beam patterns&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE K-WAVE GRID&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% set the size of the perfectly matched layer (PML)&#60;br /&#62;
PML_X_SIZE = 20; % [grid points]&#60;br /&#62;
PML_Y_SIZE = 10; % [grid points]&#60;br /&#62;
PML_Z_SIZE = 10; % [grid points]&#60;/p&#62;
&#60;p&#62;% set total number of grid points not including the PML&#60;br /&#62;
Nx = 128 - 2*PML_X_SIZE; % [grid points]&#60;br /&#62;
Ny = 64 - 2*PML_Y_SIZE; % [grid points]&#60;br /&#62;
Nz = 64 - 2*PML_Z_SIZE; % [grid points]&#60;/p&#62;
&#60;p&#62;% set desired grid size in the x-direction not including the PML&#60;br /&#62;
x = 40/1000; % [m]&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = x/Nx; % [m]&#60;br /&#62;
dy = dx; % [m]&#60;br /&#62;
dz = dx; % [m]&#60;/p&#62;
&#60;p&#62;% create the k-space grid&#60;br /&#62;
kgrid =  kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE ULTRASOUND TRANSDUCER&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% physical properties of the transducer&#60;br /&#62;
transducer.number_elements =20 ; % total number of transducer elements&#60;br /&#62;
transducer.element_width = 1; % width of each element [grid points/voxels]&#60;br /&#62;
transducer.element_length = 12; % length of each element [grid points/voxels]&#60;br /&#62;
transducer.element_spacing = 0; % spacing (kerf width) between the elements [grid points/voxels]&#60;br /&#62;
transducer.radius = inf; % radius of curvature of the transducer [m]&#60;/p&#62;
&#60;p&#62;% calculate the width of the transducer in grid points&#60;br /&#62;
transducer_width = transducer.number_elements*transducer.element_width ...&#60;br /&#62;
+ (transducer.number_elements - 1)*transducer.element_spacing;&#60;/p&#62;
&#60;p&#62;% use this to position the transducer in the middle of the computational grid&#60;br /&#62;
transducer.position = round([1, Ny/2 - transducer_width/2, Nz/2 - transducer.element_length/2]);&#60;/p&#62;
&#60;p&#62;% properties used to derive the beamforming delays&#60;br /&#62;
transducer.sound_speed = 1540; % sound speed [m/s]&#60;br /&#62;
transducer.focus_distance = 20e-3; % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = 19e-3; % focus distance in the elevation plane [m]&#60;br /&#62;
transducer.steering_angle = 30; % steering angle [degrees]&#60;/p&#62;
&#60;p&#62;% apodization&#60;br /&#62;
transducer.transmit_apodization = 'Hanning';&#60;br /&#62;
transducer.receive_apodization = 'Rectangular';&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE MEDIUM PARAMETERS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 2000*ones(Nx,Ny,Nz) ; % [m/s] 2nd&#60;br /&#62;
medium.sound_speed(1:Nx/2,:,:) = 1000 ; % [m/s] 1st 101&#60;br /&#62;
medium.density = 2000*ones(Nx,Ny,Nz); % [kg/m^3] 2nd&#60;br /&#62;
medium.density(1:round(Nx/2),:,:) = 1134 ; % [kg/m^3] 1st&#60;/p&#62;
&#60;p&#62;medium.alpha_coeff = 0.001*ones(Nx,Ny,Nz); % [dB/(MHz^y cm)] 2nd&#60;br /&#62;
medium.alpha_coeff(1:round(Nx/2),:,:)=0.01 ; % [dB/(MHz^y cm)] 1st&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.BonA = 6;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t_end = 45e-6; % [s]&#60;br /&#62;
kgrid.makeTime(medium.sound_speed, [], t_end);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE SOURCE&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define properties of the input signal&#60;br /&#62;
source_strength = 1.0e6; % [Pa]&#60;br /&#62;
tone_burst_freq = 1.0e6; % [Hz]&#60;br /&#62;
tone_burst_cycles = 5;&#60;/p&#62;
&#60;p&#62;% create an element index relative to the centre element of the transducer&#60;br /&#62;
element_index = -(transducer.number_elements - 1)/2:(transducer.number_elements - 1)/2;&#60;/p&#62;
&#60;p&#62;% use geometric beam forming to calculate the tone burst offsets for each&#60;br /&#62;
% transducer element based on the element index&#60;br /&#62;
tone_burst_offset =  180+transducer.element_spacing * element_index * ...&#60;br /&#62;
    sin(transducer.steering_angle * pi/180) / (medium.sound_speed(1,1) * kgrid.dt);&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles, 'SignalOffset', tone_burst_offset);&#60;/p&#62;
&#60;p&#62;% scale the source magnitude by the source_strength divided by the&#60;br /&#62;
% impedance (the source is assigned to the particle velocity)&#60;br /&#62;
input_signal = (source_strength./(1000*1134)).*input_signal;&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;br /&#62;
number_active_elements = 21;&#60;br /&#62;
transducer.active_elements = ones(transducer.number_elements, 1);&#60;br /&#62;
%transducer.active_elements = zeros(transducer.number_elements, 1);&#60;br /&#62;
%transducer.active_elements(21:52) = 1;&#60;/p&#62;
&#60;p&#62;% append input signal used to drive the transducer&#60;br /&#62;
transducer.input_signal = sum(input_signal);&#60;/p&#62;
&#60;p&#62;% create the transducer using the defined settings&#60;br /&#62;
transducer = kWaveTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62;% print out transducer properties&#60;br /&#62;
transducer.properties;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% set the input settings&#60;br /&#62;
input_args = {'DisplayMask', transducer.active_elements_mask, ...&#60;br /&#62;
'PMLInside', false, 'PlotPML', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
'DataCast', DATA_CAST, 'PlotScale', [-source_strength/2, source_strength/2]};&#60;/p&#62;
&#60;p&#62;% opertation simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
scan_line = transducer.scan_line(sensor_data);&#60;br /&#62;
save a_scan_eun scan_line;&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% VISUALISATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% plot the recorded time series&#60;br /&#62;
figure;&#60;br /&#62;
stackedPlot(kgrid.t_array*1e6, sensor_data);&#60;br /&#62;
xlabel('Time [\mus]');&#60;br /&#62;
ylabel('Transducer Element');&#60;br /&#62;
title('Recorded Pressure');&#60;/p&#62;
&#60;p&#62;% plot the scan line&#60;br /&#62;
figure;&#60;br /&#62;
plot(kgrid.t_array*1e6, scan_line, 'k-');&#60;br /&#62;
xlabel('Time [\mus]');&#60;br /&#62;
ylabel('Pressure [au]');&#60;br /&#62;
title('Scan Line After Beamforming');&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SENSOR MASK&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% 通过中心平面定义一个传感器掩模&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
switch MASK_PLANE&#60;br /&#62;
    case 'xy'&#60;/p&#62;
&#60;p&#62;        % Define the mask&#60;br /&#62;
        sensor.mask(:, :, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;        % Store Y-axis attributes&#60;br /&#62;
        Nj = Ny;&#60;br /&#62;
        j_vec = kgrid.y_vec;&#60;br /&#62;
        j_label = 'y';&#60;/p&#62;
&#60;p&#62;    case 'xz'&#60;/p&#62;
&#60;p&#62;        % Define the mask&#60;br /&#62;
        sensor.mask(:, Ny/2, :) = 1;&#60;/p&#62;
&#60;p&#62;        % tore z-axis attributes&#60;br /&#62;
        Nj = Nz;&#60;br /&#62;
        j_vec = kgrid.z_vec;&#60;br /&#62;
        j_label = 'z';&#60;/p&#62;
&#60;p&#62;end &#60;/p&#62;
&#60;p&#62;% Set record mode so that only RMS and peaks are stored&#60;br /&#62;
if USE_STATISTICS&#60;br /&#62;
    sensor.record = {'p_rms', 'p_max'};&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% Create input Settings&#60;br /&#62;
input_args = {'DisplayMask', transducer.all_elements_mask, ...&#60;br /&#62;
    'PMLInside', false, 'PlotPML', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotScale', [-1/2, 1/2] * source_strength};&#60;/p&#62;
&#60;p&#62;% If the full time history is stored, the data is streamed to disk in chunks of 100&#60;br /&#62;
if ~USE_STATISTICS&#60;br /&#62;
    input_args = [input_args {'StreamToDisk', 100}];&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% COMPUTE THE BEAM PATTERN USING SIMULATION STATISTICS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;if USE_STATISTICS&#60;/p&#62;
&#60;p&#62;    % Remodel the returned RMS and Max fields to their original positions&#60;br /&#62;
    sensor_data.p_rms = reshape(sensor_data.p_rms, [Nx, Nj]);&#60;br /&#62;
    sensor_data.p_max = reshape(sensor_data.p_max, [Nx, Nj]);&#60;/p&#62;
&#60;p&#62;    % Plot sound pressure diagram with maximum pressure&#60;br /&#62;
    figure(1);&#60;br /&#62;
    imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, sensor_data.p_max * 1e-6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using Maximum Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image&#60;/p&#62;
&#60;p&#62;    % Draw sound pressure diagram with RMS pressure&#60;br /&#62;
    figure(2);&#60;br /&#62;
    imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, sensor_data.p_rms * 1e-6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using RMS Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image;&#60;/p&#62;
&#60;p&#62;    % end&#60;br /&#62;
    return&#60;br /&#62;
    end &#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% COMPUTE THE BEAM PATTERN FROM THE AMPLITUDE SPECTRUM&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% Readjust sensor data to its original position so that it can be indexed as sensor_data(x, %j, t)&#60;br /&#62;
sensor_data = reshape(sensor_data, [Nx, Nj, kgrid.Nt]);&#60;/p&#62;
&#60;p&#62;% Calculated amplitude spectrum&#60;br /&#62;
[freq, amp_spect] = spect(sensor_data, 1/kgrid.dt, 'Dim', 3);&#60;/p&#62;
&#60;p&#62;% Calculate the frequency index of the source frequency and its harmonic appearance&#60;br /&#62;
[f1_value, f1_index] = findClosest(freq, tone_burst_freq);&#60;br /&#62;
[f2_value, f2_index] = findClosest(freq, 2 * tone_burst_freq);&#60;/p&#62;
&#60;p&#62;%The amplitude at the source frequency is extracted and stored&#60;br /&#62;
beam_pattern_f1 = amp_spect(:, :, f1_index);&#60;/p&#62;
&#60;p&#62;% The amplitude at the second harmonic is extracted and stored&#60;br /&#62;
beam_pattern_f2 = amp_spect(:, :, f2_index);       &#60;/p&#62;
&#60;p&#62;% The amplitude at the second harmonic is extracted and stored&#60;br /&#62;
beam_pattern_total = sum(amp_spect, 3);&#60;/p&#62;
&#60;p&#62;% Draw the beam pattern&#60;br /&#62;
figure(3);&#60;br /&#62;
imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, beam_pattern_f1 * 1e-3);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Beam Pattern At Source Fundamental');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [kPa]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;figure(4);&#60;br /&#62;
imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, beam_pattern_f2 * 1e-3);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Beam Pattern At Second Harmonic');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [kPa]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;figure(5);&#60;br /&#62;
imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, beam_pattern_total * 1e-6);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Total Beam Pattern Using Integral Of Recorded Pressure');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% PLOT DIRECTIVITY PATTERN AT FOCUS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% Calculate the directivity of each harmonic&#60;br /&#62;
directivity_f1 = squeeze(beam_pattern_f1(round(transducer.focus_distance/dx), :));&#60;br /&#62;
directivity_f2 = squeeze(beam_pattern_f2(round(transducer.focus_distance/dx), :));&#60;/p&#62;
&#60;p&#62;% Normalization&#60;br /&#62;
directivity_f1 = directivity_f1 ./ max(directivity_f1(:));&#60;br /&#62;
directivity_f2 = directivity_f2 ./ max(directivity_f2(:));&#60;/p&#62;
&#60;p&#62;% Calculate the relative Angle from the sensor&#60;br /&#62;
if strcmp(MASK_PLANE, 'xy')&#60;br /&#62;
    horz_axis = ((1:Ny) - Ny/2) * dy;&#60;br /&#62;
else&#60;br /&#62;
    horz_axis = ((1:Nz) - Nz/2) * dz;&#60;br /&#62;
end&#60;br /&#62;
angles = 180 * atan2(horz_axis, transducer.focus_distance) / pi;&#60;/p&#62;
&#60;p&#62;% Draw a directivity map&#60;br /&#62;
figure(6);&#60;br /&#62;
plot(angles, directivity_f1, 'k-', angles, directivity_f2, 'k--');&#60;br /&#62;
axis tight;&#60;br /&#62;
xlabel('Angle [deg]');&#60;br /&#62;
ylabel('Normalised Amplitude');&#60;br /&#62;
legend('Fundamental', 'Second Harmonic', 'Location', 'NorthWest');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
