<?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: Unknown signal in simulation</title>
		<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 15:10:57 +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/unknown-signal-in-simulation" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Unknown signal in simulation"</title>
			<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation#post-6012</link>
			<pubDate>Sun, 25 Jun 2017 19:14:18 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6012@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi George,&#60;/p&#62;
&#60;p&#62;There is no way to automatically spatially smooth a source time series. However, you can remove high temporal frequencies using the &#60;code&#62;filterTimeSeries&#60;/code&#62; function. &#60;/p&#62;
&#60;p&#62;Alternatively, if you want to replicate the same behaviour as smoothing a p0 source, see the second part of the &#34;Filtering A Delta Function Input Signal Example&#34;.&#60;/p&#62;
&#60;p&#62;Note, my previous post above was about smoothing the medium parameters, rather than the source.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>galexop on "Unknown signal in simulation"</title>
			<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation#post-6009</link>
			<pubDate>Fri, 23 Jun 2017 21:43:25 +0000</pubDate>
			<dc:creator>galexop</dc:creator>
			<guid isPermaLink="false">6009@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;How does one turn smoothing on, especially for a binary source mask with a source time series (i.e. a source that cant simply be defined by source.p0)?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
George
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jrtc on "Unknown signal in simulation"</title>
			<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation#post-5131</link>
			<pubDate>Wed, 08 Jul 2015 16:30:17 +0000</pubDate>
			<dc:creator>jrtc</dc:creator>
			<guid isPermaLink="false">5131@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you so much for your help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Unknown signal in simulation"</title>
			<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation#post-5126</link>
			<pubDate>Wed, 08 Jul 2015 12:35:02 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5126@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Rodrigo,&#60;/p&#62;
&#60;p&#62;This is related to the efficacy of the perfectly matched layer (PML). Your source frequency is quite close to the maximum supported frequency of the grid (the PML doesn't work that well close to 2 points per wavelength), and the PML is also quite thin. This means some of the energy from the source wraps around the domain from top to bottom. As the signal diffracted around the disc is already very low, this becomes very noticeable on your plot. Increasing the size of the PML, reducing your source frequency, or increasing the size of the grid will all act to reduce this early arriving signal. I'd also suggest turning smoothing on to reduce the staircasing effects of the cylinder.&#60;/p&#62;
&#60;p&#62;For example, using your code and changing scale to 2, increasing the size of the PML to 20, and setting 'Smooth', true generates the following trace:&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://www.k-wave.org/images/2015-07-08-forum_question_jrtc.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jrtc on "Unknown signal in simulation"</title>
			<link>http://www.k-wave.org/forum/topic/unknown-signal-in-simulation#post-5116</link>
			<pubDate>Wed, 01 Jul 2015 18:27:37 +0000</pubDate>
			<dc:creator>jrtc</dc:creator>
			<guid isPermaLink="false">5116@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Good day.&#60;/p&#62;
&#60;p&#62;I've been trying to simulate a aluminum circle immersed in water with 'pstdElastic2D' in order to see the behavior of an ultrasonic signal passing through it. I have used the following code for simulation: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clc
clear all
close all

% =========================================================================
% SIMULATION PARAMETERS
% =========================================================================

% change scale to 2 to reproduce the higher resolution figures used in the
% help file
scale = 1;

% create the computational grid
PML_size = 10*scale;         % size of the PML in grid points
Nx = 220*scale - 2*PML_size; % number of grid points in the x direction
Ny = 220*scale - 2*PML_size; % number of grid points in the y direction
dx = 0.1e-3/scale;           % grid point spacing in the x direction [m]
dy = 0.1e-3/scale;           % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);

% define the medium properties
% === WATER
cp1 = 1480;         % compressional wave speed [m/s], 1540 === 1480
cs1 = 0;            % shear wave speed [m/s]
rho1 = 1000;        % density [kg/m^3]
alpha0_p1 = 0.0;    % compressional wave absorption [dB/(MHz^2 cm)]
alpha0_s1 = 0.0;    % shear wave absorption [dB/(MHz^2 cm)]

% === ALUMINUM
cp2 = 6320;         % compressional wave speed [m/s], 3000 === 6320
cs2 = 3100;         % shear wave speed [m/s], 1400 === 3772
rho2 = 2720;        % density [kg/m^3], 1850
alpha0_p2 = 1;      % compressional wave absorption [dB/(MHz^2 cm)]
alpha0_s2 = 1;      % shear wave absorption [dB/(MHz^2 cm)]

% create the time array
cfl   = 0.1;
t_end = 15e-6;
kgrid.t_array= makeTime(kgrid, cp2, cfl, t_end);

% define position of heterogeneous slab
slab = zeros(Nx, Ny);

r = 22*scale;
a = Nx/2;
b = Ny/2;

for i = a-r+1: a+r
    y1 = b - sqrt(r^2 - (i-a)^2); % == (i-(a-r))
    y2 = b + sqrt(r^2 - (i-a)^2); % == (i-(a-r))
    slab(i, floor(y1): floor(y2)) = 1;
end

% slab(Nx/2:3*Nx/4, Nx/2:3*Nx/4) = 1;

% define the source properties
source_freq = 5e6;              % [Hz]
source_strength = 1e3;          % [Pa]
source_cycles = 5;              % number of tone burst cycles

for j = 3: 3

% === Transmisor TX
TX = zeros(Nx, Ny);
dT = 24*scale;
aT = 0; % 5
% === Distancias para dx
dxT = [ (Nx/2) - r - dT;     % ==== Máximo a la izquierda
        (Nx/2) - (r/2) - dT; % ==== Medio a la izquierda
        (Nx/2) - dT/2;       % ==== Centro
        (Nx/2) + (r/2);      % ==== Medio a la derecha
        (Nx/2) + r ];        % ==== Máximo a la derecha
dy = (Ny/2) - 80*scale;
TX(dy-aT: dy, dxT(j): dxT(j) + dT) = 1;

% source_mask = zeros(Nx, Ny);
source_mask = TX;

% define the sensor to record the maximum particle velocity everywhere
% sensor.record = {&#38;#39;u_max_all&#38;#39;};

sensor.record = {&#38;#39;p&#38;#39;, &#38;#39;p_final&#38;#39;, &#38;#39;p_max&#38;#39;, &#38;#39;u_max_all&#38;#39;};
% === Receptor RX
RX = zeros(Nx, Ny);
dxR = [ (Nx/2) - r - dT      ; % ==== Máximo a la izquierda
        (Nx/2) - (r/2) - dT  ; % ==== Medio a la izquierda
        (Nx/2) - dT/2        ; % ==== Centro
        (Nx/2) + (r/2)       ; % ==== Medio a la derecha
        (Nx/2) + r           ];% ==== Máximo a la derecha
dy = (Ny/2) + 80*scale;
RX(dy: dy+aT, dxR(j): dxR(j) + dT) = 1;

sensor.mask =(RX); % =====
% sensor.record = {&#38;#39;p&#38;#39;, &#38;#39;p_final&#38;#39;, &#38;#39;p_max&#38;#39;, &#38;#39;u_max_all&#38;#39;};

% set the input arguments
input_args = {&#38;#39;PMLSize&#38;#39;, PML_size, &#38;#39;PMLAlpha&#38;#39;, 2, &#38;#39;PlotPML&#38;#39;, false, ...
    &#38;#39;PMLInside&#38;#39;, false, &#38;#39;PlotScale&#38;#39;, [-1, 1]*source_strength, ...
    &#38;#39;DisplayMask&#38;#39;, &#38;#39;off&#38;#39;, &#38;#39;DataCast&#38;#39;, &#38;#39;single&#38;#39;};

% =========================================================================
% ELASTIC SIMULATION
% =========================================================================

% define the medium properties
clear medium
medium.sound_speed_compression            = cp1*ones(Nx, Ny);
medium.sound_speed_compression(slab == 1) = cp2;
medium.sound_speed_shear                  = cs1*ones(Nx, Ny);
medium.sound_speed_shear(slab == 1)       = cs2;
medium.density                            = rho1*ones(Nx, Ny);
medium.density(slab == 1)                 = rho2;
medium.alpha_coeff_compression            = alpha0_p1*ones(Nx, Ny);
medium.alpha_coeff_compression(slab == 1) = alpha0_p2;
medium.alpha_coeff_shear                  = alpha0_s1*ones(Nx, Ny);
medium.alpha_coeff_shear(slab == 1)       = alpha0_s2;

% assign the source
clear source
source.s_mask = source_mask;
% source.p0 = -source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);
source.sxx = source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);
source.syy = source.sxx;
source.s_mode = &#38;#39;dirichlet&#38;#39;;

clear sensor
sensor.mask =(RX);
sensor.record = {&#38;#39;p&#38;#39;, &#38;#39;p_final&#38;#39;, &#38;#39;p_max&#38;#39;, &#38;#39;u_max_all&#38;#39;, &#38;#39;p_max_all&#38;#39;};

% run the elastic simulation
sensor_data_elastic = pstdElastic2D(kgrid, medium, source, sensor, input_args{:});

% =========================================================================
% VISUALISATION
% =========================================================================

% define plot vector
x_vec = kgrid.x_vec(1 + PML_size:end - PML_size)*1e3;
y_vec = kgrid.y_vec(1 + PML_size:end - PML_size)*1e3;

% calculate square of velocity magnitude
u_e = sensor_data_elastic.ux_max_all.^2 + sensor_data_elastic.uy_max_all.^2;
% u_f = sensor_data_fluid.ux_max_all.^2 + sensor_data_fluid.uy_max_all.^2;

figure(5)
imagesc(y_vec, x_vec, 20*log10(u_e./max(u_e(:))));
xlabel(&#38;#39;y [mm]&#38;#39;);
ylabel(&#38;#39;x [mm]&#38;#39;);
axis image;
colorbar;
caxis([-50, 0]);
title(&#38;#39;Elastic Model&#38;#39;);
colormap(jet(256));

% === Gráfica de la señal recibida
SDE{1} = zeros(1, size(sensor_data_elastic.p, 2));
for i = 1: size(sensor_data_elastic.p, 2)
    SDE{j}(i) = sum(sensor_data_elastic.p(:, i))/size(sensor_data_elastic.p, 1);

end

figure(12)
set(gca, &#38;#39;nextplot&#38;#39;, &#38;#39;replacechildren&#38;#39;, &#38;#39;FontSize&#38;#39;, 14)
plot(kgrid.t_array, SDE{j}, &#38;#39;r-&#38;#39;);
xlabel(&#38;#39;Time [s]&#38;#39;);
ylabel(&#38;#39;Signal Amplitude&#38;#39;);
axis([kgrid.t_array(1) kgrid.t_array(end) min(SDE{j})*1.2 max(SDE{j})*1.2])
title(&#38;#39;Sensor Pressure Signal&#38;#39;);

end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;After running the simulation i obtain a signal like this one:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://imgur.com/loWvn3s&#34;&#62;&#60;img src=&#34;http://i.imgur.com/loWvn3s.png?1&#34; title=&#34;source: imgur.com&#34; /&#62;&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I cannot identify that signal, i have no idea what it is. If some one could help me out and tell me what i am looking at would deeply appreciate it.&#60;/p&#62;
&#60;p&#62;Thanks in advanced.&#60;/p&#62;
&#60;p&#62;Rodrigo
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
