<?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: Nonlinear effect using K-Wave</title>
		<link>http://www.k-wave.org/forum/topic/nonlinear-effect-using-k-wave</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:32:21 +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/nonlinear-effect-using-k-wave" rel="self" type="application/rss+xml" />

		<item>
			<title>bencox on "Nonlinear effect using K-Wave"</title>
			<link>http://www.k-wave.org/forum/topic/nonlinear-effect-using-k-wave#post-4929</link>
			<pubDate>Mon, 05 Jan 2015 11:50:46 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">4929@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi ak714, &#60;/p&#62;
&#60;p&#62;I'm not sure what you're trying to do. Half of your elements have a different amplitude to the other half, but the frequency is the same. If you want to generate nonlinear acoustic effects you will need the amplitudes to be large, eg. 0.5e6 Pa or more.&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ak714 on "Nonlinear effect using K-Wave"</title>
			<link>http://www.k-wave.org/forum/topic/nonlinear-effect-using-k-wave#post-4919</link>
			<pubDate>Tue, 23 Dec 2014 08:47:29 +0000</pubDate>
			<dc:creator>ak714</dc:creator>
			<guid isPermaLink="false">4919@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi I'm working with k-wave &#60;/p&#62;
&#60;p&#62;First I did a Delay &#38;amp; sum image reconstruction with Phased Array in 2D simulation&#60;br /&#62;
so i want to adopt a nonlinear effects with this Phased array&#60;br /&#62;
make a half of transducers in array was exictied in different frequency and&#60;br /&#62;
make a nonlinear effect at focal points but&#60;br /&#62;
when i did in nonlinear examples it doesn't work so I wonder what is the problem&#60;br /&#62;
here it is my code&#60;/p&#62;
&#60;p&#62;clear all;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SIMULATION PROPERTIES&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define the properties used in the simulation&#60;br /&#62;
p0 = 7*10^6;                % source pressure [Pa]&#60;br /&#62;
c0 = 1500;                  % sound speed [m/s]&#60;br /&#62;
rho0 = 1000;                % density [kg/m^3]&#60;br /&#62;
alpha_0 = 0.25;             % absorption coefficient [dB/(MHz^2 cm)]&#60;br /&#62;
sigma = 1;                  % shock parameter&#60;br /&#62;
source_freq = 1e6;          % frequency [Hz]&#60;br /&#62;
points_per_wavelength = 50; % number of grid points per wavelength at f0&#60;br /&#62;
wavelength_separation = 15; % separation between the source and detector&#60;br /&#62;
pml_size = 64;              % PML size&#60;br /&#62;
CFL = 0.25;                 % &#60;/p&#62;
&#60;p&#62;% compute corresponding grid spacing&#60;br /&#62;
dx = c0/(points_per_wavelength*source_freq);  % [m]&#60;br /&#62;
dy = c0/(points_per_wavelength*source_freq);&#60;br /&#62;
% compute corresponding grid size&#60;br /&#62;
Nx = wavelength_separation*points_per_wavelength + 20;&#60;br /&#62;
Ny = wavelength_separation*points_per_wavelength + 20;&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% RUN SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy );&#60;/p&#62;
&#60;p&#62;% assign the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = ones(Nx,Ny)*c0;&#60;br /&#62;
medium.density = ones(Nx,Ny)*rho0;&#60;br /&#62;
medium.alpha_power = 2;&#60;br /&#62;
medium.alpha_coeff = alpha_0;&#60;br /&#62;
medium.alpha_mode = 'no_dispersion';&#60;/p&#62;
&#60;p&#62;% extract the maximum frequency supported by the grid&#60;br /&#62;
f_max = min(min(medium.sound_speed))/(2*dx);     % [Hz]&#60;/p&#62;
&#60;p&#62;Num_T = 128;&#60;/p&#62;
&#60;p&#62;% define a single source element&#60;br /&#62;
source.p_mask = zeros(Nx,Ny);&#60;br /&#62;
source.p_mask(Nx,Ny/2-Num_T+2:+2:Ny/2+Num_T) = 1;&#60;/p&#62;
&#60;p&#62;% define a single sensor position an integer number of wavelengths away&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(Nx/2,Ny/2)=1;&#60;/p&#62;
&#60;p&#62;x_px = wavelength_separation*points_per_wavelength;&#60;/p&#62;
&#60;p&#62;x = x_px*dx;&#60;/p&#62;
&#60;p&#62;% compute the nonlinearity coefficient required to give the correct shock&#60;br /&#62;
% parameter&#60;br /&#62;
mach_num = p0/(rho0*c0.^2);&#60;br /&#62;
k = 2*pi*source_freq/c0;&#60;br /&#62;
BonA = 2*(sigma/(mach_num*k*x) - 1);&#60;br /&#62;
medium.BonA = BonA;&#60;br /&#62;
display_mask = source.p_mask;&#60;/p&#62;
&#60;p&#62;% set the simulation options&#60;br /&#62;
input_args = {'PMLInside', false, 'PMLSize', [pml_size,pml_size], 'PMLAlpha', 1.5,'DisplayMask', display_mask...&#60;br /&#62;
    ,'RecordMovie', true, 'MovieType', 'image', 'MovieName', 'Non_linear'};&#60;/p&#62;
&#60;p&#62;% compute points per temporal period&#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;/p&#62;
&#60;p&#62;focus_X=Nx/2*dx;&#60;br /&#62;
focus_Y=0;&#60;/p&#62;
&#60;p&#62;for i=1:1:Num_T/2&#60;br /&#62;
tone_burst_offset(1,i+Num_T/2)=(sqrt(focus_X^2+focus_Y^2)-sqrt(((2*i-1)*dy-focus_Y)^2+focus_X^2))/1500/dt ;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;for i=-1:-1:-Num_T/2&#60;br /&#62;
tone_burst_offset(1,i+Num_T/2+1)=(sqrt(focus_X^2+focus_Y^2)-sqrt(((2*i+1)*dy-focus_Y)^2+focus_X^2))/1500/dt ;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;Min=min(tone_burst_offset(1,:));&#60;/p&#62;
&#60;p&#62;for i=1:1:Num_T&#60;br /&#62;
    tone_burst_offset(1,i)= tone_burst_offset(1,i)-Min;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;tone_burst_freq = source_freq*1;        % [Hz]&#60;br /&#62;
tone_burst_cycles = 10;&#60;/p&#62;
&#60;p&#62;source.p = toneBurst(1/dt, tone_burst_freq, tone_burst_cycles, 'SignalOffset', tone_burst_offset)&#60;br /&#62;
source.p = (p0./(1500*1000)).*source.p;&#60;/p&#62;
&#60;p&#62;source_lf = toneBurst(1/dt, tone_burst_freq+10^5, tone_burst_cycles, 'SignalOffset', tone_burst_offset);&#60;br /&#62;
source_lf = (p0./(1500*1000)).*source.p*2;&#60;/p&#62;
&#60;p&#62;for a=1:Num_T/2&#60;br /&#62;
    for b=1:length(source.p)&#60;/p&#62;
&#60;p&#62;    source.p(a,b) = source_lf(a,b);&#60;/p&#62;
&#60;p&#62;    end&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% create the time array using an integer number of points per period&#60;br /&#62;
t_end = Nx*dx/1500;&#60;br /&#62;
kgrid.t_array = 0:dt:t_end;    &#60;/p&#62;
&#60;p&#62;% create the source term, offset by dt/2 so there is a point that lands on the axis&#60;br /&#62;
% source.p = p0*sin(2*pi*source_freq*(kgrid.t_array));&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;plot(sensor_data)&#60;/p&#62;
&#60;p&#62;save 'data_set'&#60;/p&#62;
&#60;p&#62;[f, sensor_data_as] = spect(sensor_data(1, :), 1/dt);&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
[f_sc, scale, prefix] = scaleSI(max(f(:)));&#60;br /&#62;
plot(scale*f, sensor_data_as, 'k-');&#60;br /&#62;
ylabel('Amplitude Spectrum');&#60;br /&#62;
xlabel(['Frequency [' prefix 'Hz]']);&#60;br /&#62;
legend('Original Time Series', 'Filtered Time Series');&#60;br /&#62;
set(gca, 'XLim', [0 1]);
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
