<?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: Multiple transducers with different frequencies</title>
		<link>http://www.k-wave.org/forum/topic/multiple-transducers-with-different-frequencies</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 09:02:50 +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/multiple-transducers-with-different-frequencies" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Multiple transducers with different frequencies"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-transducers-with-different-frequencies#post-7453</link>
			<pubDate>Fri, 01 May 2020 08:21:43 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7453@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi knaftchi,&#60;/p&#62;
&#60;p&#62;It looks like you have a single source term in &#60;code&#62;source.p&#60;/code&#62;. If you want to use different source terms for different grid points (the points that are set to 1 in &#60;code&#62;source.p_mask&#60;/code&#62;) you need to define &#60;code&#62;source.p&#60;/code&#62; as a matrix indexed as &#60;code&#62;(source_index, time_index)&#60;/code&#62;. The indexing follows MATLAB's column-wise matrix indexing. There are some more details in the manual if you need them.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>knaftchi on "Multiple transducers with different frequencies"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-transducers-with-different-frequencies#post-7426</link>
			<pubDate>Mon, 20 Apr 2020 19:29:14 +0000</pubDate>
			<dc:creator>knaftchi</dc:creator>
			<guid isPermaLink="false">7426@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I am trying to set up two transducers with two different frequencies. The code runs, but the problem is I am not able to set independent frequencies for each transducer. For instance, if I want freq1 for the first transducer and freq2 for the second transducer, it runs both transducers at freq1+freq2! Could you please help me figure out where I am making a mistake? &#60;/p&#62;
&#60;p&#62;Thanks!! &#60;/p&#62;
&#60;p&#62;'% =========================================================================&#60;br /&#62;
% SIMULATION&#60;br /&#62;
% =========================================================================&#60;br /&#62;
n = 2;              % use this parameter to modulate the number&#60;br /&#62;
                    % of grid points.&#60;br /&#62;
% create the computational grid&#60;br /&#62;
Nx = n * 216;       % number of grid points in the x (row) direction&#60;br /&#62;
Ny = n * 216;       % number of grid points in the y (column) direction&#60;br /&#62;
dx = 160e-3/Nx;    	% grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;            % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500 * ones(Nx, Ny);  % [m/s]&#60;br /&#62;
medium.alpha_coeff = 0.75;                 % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.density = 1000 * ones(Nx, Ny);      %[kg/m^3]&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.makeTime(medium.sound_speed);&#60;/p&#62;
&#60;p&#62;% define the first curved transducer element&#60;br /&#62;
arc_pos_1 = [Nx/2 - 1, 1];         % [grid points]&#60;br /&#62;
radius_1 = n * 108;                % [grid points]&#60;br /&#62;
diameter_1 = n * 81 + 1;           % [grid points]&#60;br /&#62;
focus_pos_1 = [Nx/2, Ny/2];        % [grid points]&#60;br /&#62;
source_1.p_mask = makeArc([Nx, Ny], arc_pos_1, radius_1, diameter_1, focus_pos_1);&#60;br /&#62;
source_freq_1 = 1.0e6;             % [Hz]&#60;br /&#62;
source_mag_1 = 0.5;                % [Pa]&#60;br /&#62;
source_1.p = source_mag_1 * sin(2 * pi * source_freq_1 * kgrid.t_array);&#60;/p&#62;
&#60;p&#62;% filter the source to remove high frequencies not supported by the grid&#60;br /&#62;
source_1.p = filterTimeSeries(kgrid, medium, source_1.p);&#60;/p&#62;
&#60;p&#62;% define the second curved transducer element&#60;br /&#62;
arc_pos_2 = [1, Ny/2];             % [grid points]&#60;br /&#62;
radius_2 = n * 108;                % [grid points]&#60;br /&#62;
diameter_2 = n * 81 + 1;           % [grid points]&#60;br /&#62;
focus_pos_2 = [Nx/2, Ny/2];        % [grid points]&#60;br /&#62;
source_2.p_mask = makeArc([Nx, Ny], arc_pos_2, radius_2, diameter_2, focus_pos_2);&#60;br /&#62;
source_freq_2 = 0.5e6;             % [Hz]&#60;br /&#62;
source_mag_2 = 0.50;               % [Pa]&#60;br /&#62;
source_2.p = source_mag_2 * sin(2 * pi * source_freq_2 * kgrid.t_array);&#60;/p&#62;
&#60;p&#62;% filter the source to remove high frequencies not supported by the grid&#60;br /&#62;
source_2.p = filterTimeSeries(kgrid, medium, source_2.p);&#60;/p&#62;
&#60;p&#62;% combine the two sources&#60;br /&#62;
source.p = source_1.p + source_2.p;&#60;/p&#62;
&#60;p&#62;% filter the final source&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;% create a display mask to display the transducer&#60;br /&#62;
source.p_mask = source_1.p_mask + source_2.p_mask;&#60;/p&#62;
&#60;p&#62;% create a sensor mask covering the entire computational domain using the&#60;br /&#62;
% opposing corners of a rectangle&#60;br /&#62;
sensor.mask = [1, 1, Nx, Ny].';&#60;/p&#62;
&#60;p&#62;% set the record mode capture the final wave-field and the statistics at&#60;br /&#62;
% each sensor point&#60;br /&#62;
sensor.record = {'p', 'p_max', 'u'};&#60;/p&#62;
&#60;p&#62;% assign the input options&#60;br /&#62;
input_args = {'DisplayMask', source.p_mask, 'PMLInside', false, 'PlotPML', false};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});'
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
