<?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: How can a sensor move??</title>
		<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:09:43 +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/how-can-a-sensor-move" rel="self" type="application/rss+xml" />

		<item>
			<title>mosina_ir2006@yahoo.com on "How can a sensor move??"</title>
			<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move#post-2574</link>
			<pubDate>Mon, 22 Apr 2013 16:50:54 +0000</pubDate>
			<dc:creator>mosina_ir2006@yahoo.com</dc:creator>
			<guid isPermaLink="false">2574@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;can you send to me the correct code??  i need it!  &#60;/p&#62;
&#60;p&#62;best regard
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "How can a sensor move??"</title>
			<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move#post-2292</link>
			<pubDate>Tue, 16 Apr 2013 15:53:30 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">2292@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If you know the path of your sensor through the domain (and the dependence of this on time), you can use this information to extract a single time series from your recorded data. For example, if you know your sensor is at a particular position at time t_index = 1, you can extract the value for that time index from the neighbouring grid points using linear interpolation, and so on for t_index = 2, 3, 4...&#60;/p&#62;
&#60;p&#62;For example, if you have recorded the field over entire domain, you can reshape the field at a particular time-step using something like:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;p_field = reshape(sensor_data.p(:, t_index), [Nx, Ny]);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;You can then extract the pressure at your moving sensor from this field using standard MATLAB interpolation tools and the current position of your sensor. Then continue to loop through the field for the entire simulation.&#60;/p&#62;
&#60;p&#62;If you don't want to store the entire field and extract the values in post processing, you could also modify the source codes directly to do this at each time step.&#60;/p&#62;
&#60;p&#62;Hope you can get it to work,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mosina_ir2006@yahoo.com on "How can a sensor move??"</title>
			<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move#post-2262</link>
			<pubDate>Sat, 13 Apr 2013 07:59:25 +0000</pubDate>
			<dc:creator>mosina_ir2006@yahoo.com</dc:creator>
			<guid isPermaLink="false">2262@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;hi, tanx  for your answer.&#60;br /&#62;
I can’t  show  the  sensor  that  moves. I want to calculate the pressure in each times on the direction, but  I can’t.&#60;br /&#62;
Please check my source code!!&#60;br /&#62;
please help me. Please!!!&#60;/p&#62;
&#60;p&#62;'clear all;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nx = 64;            % number of grid points in the x (row) direction&#60;br /&#62;
Ny = Nx*2;          % number of grid points in the y (column) direction&#60;br /&#62;
dy = 20e-3/Ny;    	% grid point spacing in the y direction [m]&#60;br /&#62;
dx = dy;            % grid point spacing in the x direction [m]&#60;br /&#62;
pml_size = 20;      % [pixels]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500;      % [m/s]&#60;br /&#62;
medium.alpha_coeff = 0.75;      % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5; &#60;/p&#62;
&#60;p&#62;% set the velocity of the moving source&#60;br /&#62;
source_vel = 150;               % [m/s]&#60;/p&#62;
&#60;p&#62;% set the relative x-position between the source and sensor&#60;br /&#62;
source_sensor_x_distance = 10;   % [grid points]&#60;/p&#62;
&#60;p&#62;% manually create the time array&#60;br /&#62;
dt = 20e-9;                     % [s]&#60;br /&#62;
t_end = (Ny - 2*pml_size - 2)*dy / source_vel;&#60;br /&#62;
kgrid.t_array = 0:dt:t_end;&#60;/p&#62;
&#60;p&#62;% define a single source point&#60;br /&#62;
source_x_pos = 5;               % [grid points]&#60;br /&#62;
source.p_mask = zeros(Nx, Ny);&#60;br /&#62;
source.p_mask(end - pml_size - source_x_pos - source_sensor_x_distance, end - pml_size - Ny/4) = 1;&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal source&#60;br /&#62;
source_freq = 0.75e6;   % [Hz]&#60;br /&#62;
source_mag = 2;         % [Pa]&#60;br /&#62;
source.p = source_mag*sin(2*pi*source_freq*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.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;% define a large area detector&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(end - pml_size - source_x_pos, 1 + pml_size:end - pml_size) = 1;&#60;br /&#62;
% preallocate an empty pressure source matrix&#60;br /&#62;
num_sensor_positions = sum(sensor.mask(:));&#60;br /&#62;
sensor.record = {'p_max','p'};&#60;/p&#62;
&#60;p&#62;% assign the input options&#60;br /&#62;
display_mask = source.p_mask ;&#60;/p&#62;
&#60;p&#62;input_args = {'DisplayMask', display_mask,  '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;
&#60;p&#62;%sensor_data.p_max = reshape(sensor_data.p_max,1,num_sensor_positions);&#60;/p&#62;
&#60;p&#62;%make same size the sensor_data.p_max to source.p_mask&#60;br /&#62;
max_pressure = zeros(Nx,Ny);'
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "How can a sensor move??"</title>
			<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move#post-1844</link>
			<pubDate>Thu, 28 Mar 2013 08:19:24 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">1844@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;One way would be to define a binary sensor mask that traces the complete path of your moving sensor. In post processing, you can then interpolate between the recorded data from position to position.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mosina_ir2006@yahoo.com on "How can a sensor move??"</title>
			<link>http://www.k-wave.org/forum/topic/how-can-a-sensor-move#post-1823</link>
			<pubDate>Wed, 27 Mar 2013 22:25:58 +0000</pubDate>
			<dc:creator>mosina_ir2006@yahoo.com</dc:creator>
			<guid isPermaLink="false">1823@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, the K-Wave is usefull toolbox.&#60;br /&#62;
I want to simulate a sensor is moving along a line same as &#34;The Doppler Effect&#34; example, but in our example source doesn't move and sensor moves.&#60;br /&#62;
how can i do it???&#60;/p&#62;
&#60;p&#62;best regard
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
