<?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: Simulation of the reflected acoustic waves from a moving object inside a room</title>
		<link>http://www.k-wave.org/forum/topic/simulation-of-the-reflected-acoustic-waves-from-a-moving-object-inside-a-room</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:32:11 +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/simulation-of-the-reflected-acoustic-waves-from-a-moving-object-inside-a-room" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Simulation of the reflected acoustic waves from a moving object inside a room"</title>
			<link>http://www.k-wave.org/forum/topic/simulation-of-the-reflected-acoustic-waves-from-a-moving-object-inside-a-room#post-4537</link>
			<pubDate>Thu, 22 May 2014 15:08:40 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4537@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi bashjokh,&#60;/p&#62;
&#60;p&#62;It is certainly possible to make a source move within the grid, however, it is not completely trivial to code. The basic idea is to vary the source signal used for each grid point within the source mask over time. There is an example of how to do this in the toolbox as part of the &#60;a href=&#34;http://www.k-wave.org/documentation/example_tvsp_doppler_effect.php&#34;&#62;Doppler Effect Example&#60;/a&#62;. You might also find &#60;a href=&#34;http://www.k-wave.org/forum/topic/doppler-effect-of-the-source&#34;&#62;this post&#60;/a&#62; useful. &#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bashjokh on "Simulation of the reflected acoustic waves from a moving object inside a room"</title>
			<link>http://www.k-wave.org/forum/topic/simulation-of-the-reflected-acoustic-waves-from-a-moving-object-inside-a-room#post-4511</link>
			<pubDate>Sun, 11 May 2014 20:52:42 +0000</pubDate>
			<dc:creator>bashjokh</dc:creator>
			<guid isPermaLink="false">4511@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I'm new to k-wave, and i'm trying now to simulate the recorded sound waves from a moving object in a room. As start point I have used the following code: &#60;/p&#62;
&#60;p&#62;clear all;&#60;/p&#62;
&#60;p&#62;% set the PML size&#60;br /&#62;
PML_size = 20;&#60;/p&#62;
&#60;p&#62;% create the computational grid [ 3m by 3m domain ]&#60;br /&#62;
Nx = 128 - 2*PML_size;  % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 128 - 2*PML_size;  % number of grid points in the y (column) direction&#60;br /&#62;
dx = 3/Nx;              % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 3/Ny;              % grid point spacing in the y direction [m]&#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;
c_air = 330;        % [m/s] sound speed&#60;br /&#62;
rho_air = 1.225;    % [kg/m^3] density&#60;/p&#62;
&#60;p&#62;% define the properties of the object&#60;br /&#62;
c_object = 1000;      % [m/s]&#60;br /&#62;
rho_object = 1000;    % [kg/m^3]&#60;br /&#62;
thickness = 5;     % [grid points]&#60;/p&#62;
&#60;p&#62;% define the position of the object&#60;br /&#62;
object_y_pos = Ny/2;&#60;br /&#62;
object_x_pos = Nx/4;&#60;br /&#62;
object= zeros(Nx, Ny);&#60;br /&#62;
object(object_x_pos : end - end/4, object_y_pos : end - end/2 + thickness) = 1;&#60;/p&#62;
&#60;p&#62;% assign the medium properties&#60;br /&#62;
medium.sound_speed = c_air*ones(Nx, Ny);&#60;br /&#62;
medium.sound_speed(object == 1) = c_object;&#60;br /&#62;
medium.density = rho_air*ones(Nx, Ny);&#60;br /&#62;
medium.density(object == 1) = rho_object;&#60;/p&#62;
&#60;p&#62;% set the velocity of the moving object&#60;br /&#62;
obj_vel = 150;               % [m/s]&#60;/p&#62;
&#60;p&#62;% set the reference sound speed used in the k-space operator&#60;br /&#62;
medium.sound_speed_ref = c_air;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
cfl = 0.2;     %Courant-Friedrichs-Lewy number&#60;br /&#62;
t_end = 20e-3;      % [s]&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed, cfl, t_end);&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal source&#60;br /&#62;
%source_freq = 1.5e3;  % [Hz]&#60;br /&#62;
source_mag = 50;    % [Pa]&#60;br /&#62;
%source.p = source_mag*sin(2*pi*source_freq*kgrid.t_array);&#60;br /&#62;
% define a tone burst&#60;br /&#62;
sampling_freq = 1/dt;   % [Hz]&#60;br /&#62;
tone_burst_freq = 1.5e3;  % [Hz]&#60;br /&#62;
tone_burst_cycles = 3;&#60;br /&#62;
source.p = source_mag*toneBurst(sampling_freq, tone_burst_freq, tone_burst_cycles);&#60;br /&#62;
% define a single source point&#60;br /&#62;
source.p_mask = zeros(Nx, Ny);&#60;br /&#62;
source.p_mask(end/2, end/4) = 1;&#60;/p&#62;
&#60;p&#62;% define sensor point&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(end/2, end/4) = 1;&#60;/p&#62;
&#60;p&#62;display_mask = object + sensor.mask;&#60;br /&#62;
% define the acoustic parameters to record&#60;br /&#62;
%sensor.record = {'p'};&#60;/p&#62;
&#60;p&#62;% run simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, ...&#60;br /&#62;
    'PMLInside', false, 'PlotPML', false, 'PMLSize', PML_size, ...&#60;br /&#62;
    'DisplayMask', display_mask, 'PlotScale', [-0.25, 0.25]*source_mag,...&#60;br /&#62;
    'DataCast', 'single');&#60;/p&#62;
&#60;p&#62;% plot the recorded data&#60;br /&#62;
figure;&#60;br /&#62;
subplot(2, 1, 1);&#60;br /&#62;
[t_sc scale prefix] = scaleSI(max(kgrid.t_array(:)));&#60;br /&#62;
plot(source.p, 'b-');&#60;br /&#62;
xlabel(['Time [' prefix 's]']);&#60;br /&#62;
ylabel('Signal Amplitude');&#60;br /&#62;
axis tight;&#60;br /&#62;
title('Source Pressure Signal');&#60;/p&#62;
&#60;p&#62;subplot(2, 1, 2), plot(kgrid.t_array*scale, sensor_data, 'r-');&#60;br /&#62;
xlabel(['Time [' prefix 's]']);&#60;br /&#62;
ylabel('Signal Amplitude');&#60;br /&#62;
axis tight;&#60;br /&#62;
title('Sensor Pressure Signal');&#60;/p&#62;
&#60;p&#62;and now I ca not know how to let the object move inside the computational grid. I will appreciate any help!&#60;/p&#62;
&#60;p&#62;Best Regards
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
