<?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: questions about the example: equivalent_source_holography</title>
		<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:28:37 +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/questions-about-the-example-equivalent_source_holography" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "questions about the example: equivalent_source_holography"</title>
			<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography#post-7552</link>
			<pubDate>Sat, 06 Jun 2020 13:33:38 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7552@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi ykx,&#60;/p&#62;
&#60;p&#62;Do you get better agreement if you run a linear simulation (comment out the &#60;code&#62;medium.BonA&#60;/code&#62; line)? Otherwise, your code looks reasonable at first glance. I don't think you should need such a fine grid - everything is homogeneous so even lambda/4 should be fine for the linear simulations.&#60;/p&#62;
&#60;p&#62;Regarding the large grids, the function &#60;code&#62;calculateMassSourceCW&#60;/code&#62; uses &#60;code&#62;acousticFieldPropagator&#60;/code&#62;. This can become memory intensive for large grids. Try using the C++ code (you can download this from the downloads page) by setting &#60;code&#62;&#38;#39;UseCpp&#38;#39;, true&#60;/code&#62; when you call &#60;code&#62;calculateMassSourceCW&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jackYANG on "questions about the example: equivalent_source_holography"</title>
			<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography#post-7494</link>
			<pubDate>Mon, 11 May 2020 01:43:03 +0000</pubDate>
			<dc:creator>jackYANG</dc:creator>
			<guid isPermaLink="false">7494@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi ykx,&#60;br /&#62;
I encountered similar problems with you. When I changed the nonlinear parameter BonA, for example, from 5 to 10, I basically didn't notice any change in the sound pressure field. I was wondering whether my harmonic components were automatically deleted by the grid.If you are interested in communicating more with me, my email address is &#60;a href=&#34;mailto:750575018@qq.com&#34;&#62;750575018@qq.com&#60;/a&#62;.I'm a Chinese.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ykx on "questions about the example: equivalent_source_holography"</title>
			<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography#post-7493</link>
			<pubDate>Sun, 10 May 2020 14:22:48 +0000</pubDate>
			<dc:creator>ykx</dc:creator>
			<guid isPermaLink="false">7493@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Another question is the space grid is large( i.e. Nx = 667 instead), the program crashes during the calculation of equivalent source. Thanks in advance！
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ykx on "questions about the example: equivalent_source_holography"</title>
			<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography#post-7492</link>
			<pubDate>Sun, 10 May 2020 14:15:57 +0000</pubDate>
			<dc:creator>ykx</dc:creator>
			<guid isPermaLink="false">7492@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I don't know how to upload pictures...&#60;/p&#62;
&#60;p&#62;Sorry for some Chinese notes :) but it doesn't affect reading I guess.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ykx on "questions about the example: equivalent_source_holography"</title>
			<link>http://www.k-wave.org/forum/topic/questions-about-the-example-equivalent_source_holography#post-7491</link>
			<pubDate>Sun, 10 May 2020 14:11:06 +0000</pubDate>
			<dc:creator>ykx</dc:creator>
			<guid isPermaLink="false">7491@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, there! First of all, thanks for the new version of k-wave! The example equivalent_source_holography helps me a lot!&#60;/p&#62;
&#60;p&#62;I use the equivalent_source_holography example to simulate the nonlinear field of the phased array producing multi-foci field pattern. The rayleigh integral is used to calculate the linear field in the depth of one wavelength （as the value of input_plane_complex).The fundamental wave, 2nd and 3rd harmonic wave can be simulated.&#60;/p&#62;
&#60;p&#62;My question is: the fundamental wave in the simulation result is quite different with the linear field of the Rayleigh integral.The main lobe is quite similar, but the side lobes is very different.&#60;/p&#62;
&#60;p&#62;I think it is because the grid point spacing is not small enough. However, when I set dx =Lamda/14- Lamda/20 ( dx is he grid point spacing; Lamda is the wavelength of the fundemental wave),the L2 Error does not decline apparently and the harmonic fields become strange(the focus area has nearly no pressure and the boundary area has large pressure instead).&#60;/p&#62;
&#60;p&#62;How can the fundamental wave of k-wave coincides with the linear field of the Rayleigh integral?&#60;/p&#62;
&#60;p&#62; ==========================the matlab script ============================&#60;br /&#62;
% Equivalent Source Holography Example&#60;br /&#62;
tic&#60;/p&#62;
&#60;p&#62;close all&#60;br /&#62;
clearvars;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SIMULATION SETTINGS&#60;br /&#62;
% =========================================================================&#60;br /&#62;
%声源属性&#60;br /&#62;
Fre=1e6; %[Hz]&#60;br /&#62;
Sound_speed=1500; %[m/s]&#60;br /&#62;
Lamda=Sound_speed/Fre;%波长&#60;/p&#62;
&#60;p&#62;% define grid properties&#60;br /&#62;
Nx = 309;                    % 去除一部分x方向数据，以便快速计算&#60;br /&#62;
Ny = 150;                    % number of grid points in the y direction&#60;br /&#62;
Nz = 80;                    % number of grid points in the z direction&#60;br /&#62;
dx = Lamda/10;                  % grid point spacing [m]&#60;br /&#62;
c0 = 1500;                  % sound speed [m/s]&#60;/p&#62;
&#60;p&#62;%阵列参数设置&#60;br /&#62;
num=20;%对应曲阵元数量&#60;br /&#62;
a = Lamda/2;&#60;br /&#62;
b = 4*Lamda;&#60;br /&#62;
%生成阵元位置规则&#60;br /&#62;
dis= Lamda/2;%规则分布的间距&#60;/p&#62;
&#60;p&#62;% define source properties&#60;br /&#62;
source_freq = Fre;          % [Hz]&#60;br /&#62;
rect_x_radius = round((a*num+dis*(num-1))/dx);          % [grid points]&#60;br /&#62;
rect_y_radius = round(b/dx);         % [grid points]&#60;br /&#62;
input_plane_z_index = round(Lamda/dx);  	% [grid points] 大概一个波长&#60;/p&#62;
&#60;p&#62;% settings for calculating the equivalent source&#60;br /&#62;
grid_expansion = 0;&#60;br /&#62;
number_optimisation_steps = 20;&#60;br /&#62;
%the data calculated by Rayleigh integral&#60;br /&#62;
load('双焦点5mm横切面-深度λ-复数.mat')&#60;br /&#62;
input_plane_complex=pr;&#60;br /&#62;
figure&#60;br /&#62;
imagesc(abs(input_plane_complex))&#60;br /&#62;
title('输入声源数据')&#60;br /&#62;
axis equal&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dx, Nz, dx);&#60;br /&#62;
cfl = 0.3;&#60;br /&#62;
t_end = 1.2*sqrt(kgrid.x_size.^2 + kgrid.y_size.^2 + kgrid.z_size.^2) ./ c0;&#60;/p&#62;
&#60;p&#62;% assign medium properties&#60;br /&#62;
medium.sound_speed = c0;&#60;br /&#62;
medium.density = 1000;          % [kg/m^3]&#60;br /&#62;
medium.BonA = 5;%5&#60;/p&#62;
&#60;p&#62;% compute sampling rates, forcing points-per-period to be an integer&#60;br /&#62;
points_per_wavelength = c0 / (source_freq * dx);&#60;br /&#62;
points_per_period = round(points_per_wavelength / cfl);&#60;/p&#62;
&#60;p&#62;% compute corresponding time spacing&#60;br /&#62;
dt = 1 / (points_per_period * source_freq);&#60;br /&#62;
% create the time array&#60;br /&#62;
Nt = round(t_end / dt);&#60;br /&#62;
kgrid.setTime(Nt, dt);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% CALCULATE EQUIVALENT SOURCE&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% offset between the input plane and source plane [grid points]&#60;br /&#62;
source_offset = input_plane_z_index - 1;&#60;/p&#62;
&#60;p&#62;% calculate equivalent source&#60;br /&#62;
[source_estimate, optim_params] = calculateMassSourceCW(input_plane_complex, dx, ...&#60;br /&#62;
    source_freq, c0, source_offset, grid_expansion, ...&#60;br /&#62;
    'NumSteps', number_optimisation_steps);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% PROJECT MEASURED DATA USING EQUIVALENT SOURCE&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% assign source mask at the beginning of the grid&#60;br /&#62;
clear source;&#60;br /&#62;
source.p_mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
source.p_mask(:, 1, :) = 1;&#60;/p&#62;
&#60;p&#62;% assign the measured data as a dirichlet boundary condition&#60;br /&#62;
source.p = createCWSignals(kgrid.t_array, source_freq, abs(source_estimate(:)), angle(source_estimate(:)));&#60;/p&#62;
&#60;p&#62;% define a sensor mask through the central plane&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
% define mask&#60;br /&#62;
sensor.mask(:, :, Nz/2) = 1;&#60;br /&#62;
% set the start time to only record the last three periods&#60;br /&#62;
sensor.record_start_index = kgrid.Nt - 3 * points_per_period + 1;&#60;/p&#62;
&#60;p&#62;% assign input arguments&#60;br /&#62;
input_args = {...&#60;br /&#62;
    'PMLInside', false', ...&#60;br /&#62;
    'PMLSize', 'auto', ..., Nx, Ny&#60;br /&#62;
    'DataCast', 'single', ...&#60;br /&#62;
    'DataRecast', true, ...&#60;br /&#62;
    };&#60;br /&#62;
% run k-Wave simulation to project measured data&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;save('sensor_data_0508_nonlinear_Lamda10.mat','sensor_data')&#60;br /&#62;
Nt=size(sensor_data,2);&#60;br /&#62;
sensor_data = reshape(sensor_data, [Nx, Ny, Nt]);&#60;/p&#62;
&#60;p&#62;%f0&#60;br /&#62;
[proj_eqs,phase,fre] = extractAmpPhase(sensor_data, 1/kgrid.dt, source_freq, ...&#60;br /&#62;
    'Dim', 3, ...&#60;br /&#62;
    'FFTPadding', 1, ...&#60;br /&#62;
    'Window', 'Rectangular');&#60;/p&#62;
&#60;p&#62;x_vec=dx*((1:Nx)-Nx/2);%[m]&#60;br /&#62;
y_vec=dx*(1:Ny);&#60;br /&#62;
figure&#60;br /&#62;
imagesc(1000*x_vec,1000*y_vec,proj_eqs')&#60;br /&#62;
xlabel('[mm]')&#60;br /&#62;
ylabel('[mm]')&#60;/p&#62;
&#60;p&#62;%h2&#60;br /&#62;
[proj_eqs,phase,fre] = extractAmpPhase(sensor_data, 1/kgrid.dt,2* source_freq, ...&#60;br /&#62;
    'Dim', 3, ...&#60;br /&#62;
    'FFTPadding', 1, ...&#60;br /&#62;
    'Window', 'Rectangular');&#60;/p&#62;
&#60;p&#62;figure&#60;br /&#62;
imagesc(1000*x_vec,1000*y_vec,proj_eqs')&#60;br /&#62;
xlabel('[mm]')&#60;br /&#62;
ylabel('[mm]')&#60;/p&#62;
&#60;p&#62;%h3&#60;br /&#62;
[proj_eqs,phase,fre] = extractAmpPhase(sensor_data, 1/kgrid.dt,3* source_freq, ...&#60;br /&#62;
    'Dim', 3, ...&#60;br /&#62;
    'FFTPadding', 1, ...&#60;br /&#62;
    'Window', 'Rectangular');&#60;/p&#62;
&#60;p&#62;figure&#60;br /&#62;
imagesc(1000*x_vec,1000*y_vec,proj_eqs')&#60;br /&#62;
xlabel('[mm]')&#60;br /&#62;
ylabel('[mm]')
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
