<?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: spatial average time average intensity(ISATA) values from the simulation results</title>
		<link>http://www.k-wave.org/forum/topic/spatial-average-time-average-intensityisata-values-from-the-simulation-results</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:43:26 +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/spatial-average-time-average-intensityisata-values-from-the-simulation-results" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "spatial average time average intensity(ISATA) values from the simulation results"</title>
			<link>http://www.k-wave.org/forum/topic/spatial-average-time-average-intensityisata-values-from-the-simulation-results#post-7688</link>
			<pubDate>Sat, 04 Jul 2020 13:09:00 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7688@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi POORNIMA,&#60;/p&#62;
&#60;p&#62;You can't calculate acoustic intensity directly from voltage, you will need to convert your measured voltages to pressure. To convert between voltage and pressure for your experiment, you will need to use the hydrophone calibration. &#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>POORNIMA on "spatial average time average intensity(ISATA) values from the simulation results"</title>
			<link>http://www.k-wave.org/forum/topic/spatial-average-time-average-intensityisata-values-from-the-simulation-results#post-7672</link>
			<pubDate>Sun, 28 Jun 2020 12:39:47 +0000</pubDate>
			<dc:creator>POORNIMA</dc:creator>
			<guid isPermaLink="false">7672@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you for the reply. But in the simulation the values are expressed in pressure. In actual experiments, the Isata values are calculated in terms of voltage. &#60;/p&#62;
&#60;p&#62;I would like to compare the simulated intensity with the experimental intensity. How can I convert the simulated pressure values to voltage.&#60;/p&#62;
&#60;p&#62;Thanks once again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "spatial average time average intensity(ISATA) values from the simulation results"</title>
			<link>http://www.k-wave.org/forum/topic/spatial-average-time-average-intensityisata-values-from-the-simulation-results#post-7654</link>
			<pubDate>Sat, 27 Jun 2020 13:26:11 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7654@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi POORNIMA,&#60;/p&#62;
&#60;p&#62;In general, you can average the time-average intensity over the beam area (e.g., as defined in BS EN 62127-1:2007 +A1:2013). &#60;/p&#62;
&#60;p&#62;Why not use the same approach you have used to calculate Isata in the experiment?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>POORNIMA on "spatial average time average intensity(ISATA) values from the simulation results"</title>
			<link>http://www.k-wave.org/forum/topic/spatial-average-time-average-intensityisata-values-from-the-simulation-results#post-7633</link>
			<pubDate>Mon, 22 Jun 2020 07:21:00 +0000</pubDate>
			<dc:creator>POORNIMA</dc:creator>
			<guid isPermaLink="false">7633@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Is it possible to calculate the spatial average time average intensity(ISATA) from the simulation values. I have tried to simulate nonlinear ultrasound beam pattern using the example &#34;simulating ultrasound beam pattern&#34;. As the input signal for the transducer is defined in units(pa), the matrix obtained from that is also pressure value. In my real time experiments, the input signal for the transducer is defined in unit (voltage). &#60;/p&#62;
&#60;p&#62;Hence I need to calculate the ISATA values of the simulated beam pattern. Using these simulated ISATA values, I would compare the values with the actual ISATA values obtained from measuring the intensity of the transducer using a hydrophone.&#60;/p&#62;
&#60;p&#62;Thank you very much for your help.&#60;/p&#62;
&#60;p&#62;This is my code &#60;/p&#62;
&#60;p&#62;% Simulating Ultrasound Beam Patterns Example&#60;br /&#62;
%&#60;br /&#62;
% This example shows how the nonlinear beam pattern from an ultrasound&#60;br /&#62;
% transducer can be modelled. It builds on the Defining An Ultrasound&#60;br /&#62;
% Transducer and Simulating Transducer Field Patterns examples.&#60;br /&#62;
%&#60;br /&#62;
% author: Bradley Treeby&#60;br /&#62;
% date: 27th July 2011&#60;br /&#62;
% last update: 25th September 2012&#60;br /&#62;
%&#60;br /&#62;
% This function is part of the k-Wave Toolbox (&#60;a href=&#34;http://www.k-wave.org&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org&#60;/a&#62;)&#60;br /&#62;
% Copyright (C) 2009-2014 Bradley Treeby and Ben Cox&#60;/p&#62;
&#60;p&#62;% This file is part of k-Wave. k-Wave is free software: you can&#60;br /&#62;
% redistribute it and/or modify it under the terms of the GNU Lesser&#60;br /&#62;
% General Public License as published by the Free Software Foundation,&#60;br /&#62;
% either version 3 of the License, or (at your option) any later version.&#60;br /&#62;
%&#60;br /&#62;
% k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY&#60;br /&#62;
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS&#60;br /&#62;
% FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for&#60;br /&#62;
% more details.&#60;br /&#62;
%&#60;br /&#62;
% You should have received a copy of the GNU Lesser General Public License&#60;br /&#62;
% along with k-Wave. If not, see &#38;lt;http://www.gnu.org/licenses/&#38;gt;. &#60;/p&#62;
&#60;p&#62;depth = 50e-3; %50mm [m]&#60;/p&#62;
&#60;p&#62;% simulation settings&#60;br /&#62;
DATA_CAST = 'single';       % set to 'single' or 'gpuArray-single' to speed up computations&#60;br /&#62;
MASK_PLANE = 'yz';          % set to 'xy' or 'xz' to generate the beam pattern in different planes&#60;br /&#62;
USE_STATISTICS = false;      % set to true to compute the rms or peak beam patterns, set to false to compute the harmonic beam patterns&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE K-WAVE GRID&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% set the size of the perfectly matched layer (PML)&#60;br /&#62;
PML_X_SIZE = 20;            % [grid points]&#60;br /&#62;
PML_Y_SIZE = 10;            % [grid points]&#60;br /&#62;
PML_Z_SIZE = 10;            % [grid points]&#60;/p&#62;
&#60;p&#62;% set total number of grid points not including the PML&#60;br /&#62;
Nx = 128 - 2*PML_X_SIZE;    % [grid points]&#60;br /&#62;
Ny = 64 - 2*PML_Y_SIZE;     % [grid points]&#60;br /&#62;
Nz = 64 - 2*PML_Z_SIZE;     % [grid points]&#60;/p&#62;
&#60;p&#62;% % set desired grid size in the x-direction not including the PML&#60;br /&#62;
% x = 80e-3;                  % [m]&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = 1e-3;                  % [m]&#60;br /&#62;
dy = dx;                    % [m]&#60;br /&#62;
dz = dx;                    % [m]&#60;/p&#62;
&#60;p&#62;% create the k-space grid&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE MEDIUM PARAMETERS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium (skeletal muscle)&#60;br /&#62;
medium.sound_speed = 1580;      % [m/s]&#60;br /&#62;
medium.density = 1050;          % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.74;      % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.BonA = 6.6;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t_end = 100e-6;                  % [s]&#60;br /&#62;
kgrid.t_array = makeTime(kgrid, medium.sound_speed, [], t_end);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE INPUT SIGNAL&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define properties of the input signal&#60;br /&#62;
source_strength = 1e6;          % [Pa]&#60;br /&#62;
tone_burst_freq = 1.25e6;    	% [Hz]&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
input_signal = sin(2.*pi.*tone_burst_freq.*kgrid.t_array/2);&#60;/p&#62;
&#60;p&#62;% scale the source magnitude by the source_strength divided by the&#60;br /&#62;
% impedance (the source is assigned to the particle velocity)&#60;br /&#62;
input_signal = (source_strength./(medium.sound_speed*medium.density)).*input_signal;&#60;br /&#62;
%%&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% DEFINE THE ULTRASOUND TRANSDUCER&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% physical properties of the transducer&#60;br /&#62;
 transducer.number_elements = 1;    % total number of transducer elements&#60;br /&#62;
 transducer.element_width = 12;       % width of each element [grid points]&#60;br /&#62;
 transducer.element_length = 12;     % length of each element [grid points]&#60;br /&#62;
 transducer.element_spacing = 0;     % spacing (kerf  width) between the elements [grid points]&#60;br /&#62;
 transducer.radius = inf;            % radius of curvature of the transducer [m]&#60;br /&#62;
%&#60;br /&#62;
% % calculate the width of the transducer in grid points&#60;br /&#62;
 transducer_width = transducer.number_elements*transducer.element_width ...&#60;br /&#62;
     + (transducer.number_elements - 1)*transducer.element_spacing;&#60;br /&#62;
%&#60;br /&#62;
% % use this to position the transducer in the middle of the computational grid&#60;br /&#62;
 transducer.position = round([1, Ny/2 - transducer_width/2, Nz/2 - transducer.element_length/2]);&#60;/p&#62;
&#60;p&#62; % properties used to derive the beamforming delays&#60;br /&#62;
 transducer.sound_speed = 1540;              % sound speed [m/s]&#60;br /&#62;
 transducer.focus_distance = 0;          % focus distance [m]&#60;br /&#62;
 transducer.elevation_focus_distance = 0;% focus distance in the elevation plane [m]&#60;br /&#62;
 transducer.steering_angle = 0;              % steering angle [degrees]&#60;/p&#62;
&#60;p&#62; % apodization&#60;br /&#62;
 transducer.transmit_apodization = 'Rectangular';&#60;br /&#62;
 transducer.receive_apodization = 'Rectangular';&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;br /&#62;
 transducer.active_elements = 1;&#60;/p&#62;
&#60;p&#62; % append input signal used to drive the transducer&#60;br /&#62;
 transducer.input_signal = input_signal;&#60;/p&#62;
&#60;p&#62; % create the transducer using the defined settings&#60;br /&#62;
 transducer = makeTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62; % print out transducer properties&#60;br /&#62;
 transducer.properties;&#60;/p&#62;
&#60;p&#62;RADIUS = inf;&#60;br /&#62;
DIAMETER = 22E-3 / dx;&#60;/p&#62;
&#60;p&#62;grid_size = [Nx; Ny; Nz];&#60;br /&#62;
centre_pos = [2;round(Ny/2);round(Nz/2)];&#60;br /&#62;
focus_pos = [round(Nx/2);round(Ny/2);round(Nz/2)];&#60;br /&#62;
plot_bowl = true;&#60;/p&#62;
&#60;p&#62;source.p_mask = makeBowl(grid_size, centre_pos, RADIUS, DIAMETER, ...&#60;br /&#62;
    focus_pos, plot_bowl);&#60;/p&#62;
&#60;p&#62;source.p = input_signal;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SENSOR MASK&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define a sensor mask through the central plane&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
switch MASK_PLANE&#60;br /&#62;
    case 'xy'&#60;br /&#62;
        % define mask&#60;br /&#62;
        sensor.mask(:, :, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;        % store y axis properties&#60;br /&#62;
        Nj = Ny;&#60;br /&#62;
        j_vec = kgrid.y_vec;&#60;br /&#62;
        j_label = 'y';&#60;/p&#62;
&#60;p&#62;    case 'xz'&#60;br /&#62;
        % define mask&#60;br /&#62;
        sensor.mask(:, Ny/2, :) = 1;&#60;/p&#62;
&#60;p&#62;        % store z axis properties&#60;br /&#62;
        Nj = Nz;&#60;br /&#62;
        j_vec = kgrid.z_vec;&#60;br /&#62;
        j_label = 'z';&#60;/p&#62;
&#60;p&#62;     case 'yz'&#60;br /&#62;
        % define mask&#60;br /&#62;
        sensor.mask(round(depth/dx),:, :) = 1;&#60;/p&#62;
&#60;p&#62;        % store z axis properties&#60;br /&#62;
        Nj = Nz;&#60;br /&#62;
        j_vec = kgrid.x_vec;&#60;br /&#62;
        j_label = 'x';&#60;/p&#62;
&#60;p&#62;end &#60;/p&#62;
&#60;p&#62;% set the record mode such that only the rms and peak values are stored&#60;br /&#62;
if USE_STATISTICS&#60;br /&#62;
    sensor.record = {'p_rms', 'p_max'};&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% set the input settings&#60;br /&#62;
input_args = {'DisplayMask', source.p_mask, ...&#60;br /&#62;
    'PMLInside', false, 'PlotPML', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotScale', [-source_strength/2, source_strength/2]};&#60;/p&#62;
&#60;p&#62;% stream the data to disk in blocks of 100 if storing the complete time&#60;br /&#62;
% history&#60;br /&#62;
if ~USE_STATISTICS&#60;br /&#62;
    input_args = [input_args {'StreamToDisk', 100}];&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% COMPUTE THE BEAM PATTERN USING SIMULATION STATISTICS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;if USE_STATISTICS&#60;/p&#62;
&#60;p&#62;    % reshape the returned rms and max fields to their original position&#60;br /&#62;
    sensor_data.p_rms = reshape(sensor_data.p_rms, [Nx, Nj]);&#60;br /&#62;
    sensor_data.p_max = reshape(sensor_data.p_max, [Nx, Nj]);&#60;/p&#62;
&#60;p&#62;    % plot the beam pattern using the pressure maximum&#60;br /&#62;
    figure;&#60;br /&#62;
    imagesc(j_vec*1e3, (kgrid.x_vec - min(kgrid.x_vec(:)))*1e3, sensor_data.p_max/1e6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using Maximum Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image;&#60;/p&#62;
&#60;p&#62;    % plot the beam pattern using the pressure rms&#60;br /&#62;
    figure;&#60;br /&#62;
    imagesc(j_vec*1e3, (kgrid.x_vec - min(kgrid.x_vec(:)))*1e3, sensor_data.p_rms/1e6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using RMS Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image;&#60;/p&#62;
&#60;p&#62;    % end the example&#60;br /&#62;
    return&#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;voxelPlot(source.p_mask+sensor.mask)&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% COMPUTE THE BEAM PATTERN FROM THE AMPLITUDE SPECTRUM&#60;br /&#62;
% =========================================================================&#60;br /&#62;
%%&#60;br /&#62;
% reshape the sensor data to its original position so that it can be&#60;br /&#62;
% indexed as sensor_data(x, j, t)&#60;br /&#62;
sensor_data = reshape(sensor_data, [Ny, Nz, kgrid.Nt]);&#60;/p&#62;
&#60;p&#62;% compute the amplitude spectrum&#60;br /&#62;
[freq, amp_spect] = spect(sensor_data, 1/kgrid.dt, 'Dim', 3);&#60;/p&#62;
&#60;p&#62;% compute the index at which the source frequency and its harmonics occur&#60;br /&#62;
[f1_value, f1_index] = findClosest(freq, tone_burst_freq);&#60;br /&#62;
[f2_value, f2_index] = findClosest(freq, tone_burst_freq*2);&#60;/p&#62;
&#60;p&#62;% extract the amplitude at the source frequency and store&#60;br /&#62;
beam_pattern_f1 = amp_spect(:, :, f1_index);&#60;/p&#62;
&#60;p&#62;% extract the amplitude at the second harmonic and store&#60;br /&#62;
beam_pattern_f2 = amp_spect(:, :, f2_index);       &#60;/p&#62;
&#60;p&#62;% extract the integral of the total amplitude spectrum&#60;br /&#62;
beam_pattern_total = sum(amp_spect, 3);&#60;/p&#62;
&#60;p&#62;% plot the beam patterns&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(j_vec*1e3, (kgrid.x_vec - min(kgrid.x_vec(:)))*1e3, beam_pattern_f1/1e6);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Beam Pattern At Source Fundamental');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(j_vec*1e3, (kgrid.x_vec - min(kgrid.x_vec(:)))*1e3, beam_pattern_f2/1e3);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Beam Pattern At Second Harmonic');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [kPa]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(j_vec*1e3, (kgrid.x_vec - min(kgrid.x_vec(:)))*1e3, beam_pattern_total/1e6);&#60;br /&#62;
xlabel([j_label '-position [mm]']);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
title('Total Beam Pattern Using Integral Of Recorded Pressure');&#60;br /&#62;
colormap(jet(256));&#60;br /&#62;
c = colorbar;&#60;br /&#62;
ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
axis image;&#60;br /&#62;
hold on&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% PLOT DIRECTIVITY PATTERN AT FOCUS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% compute the directivity at each of the harmonics&#60;br /&#62;
directivity_f1 = squeeze(beam_pattern_f1(round(transducer.focus_distance/dx), :));&#60;br /&#62;
directivity_f2 = squeeze(beam_pattern_f2(round(transducer.focus_distance/dx), :));&#60;/p&#62;
&#60;p&#62;% normalise&#60;br /&#62;
directivity_f1 = directivity_f1./max(directivity_f1(:));&#60;br /&#62;
directivity_f2 = directivity_f2./max(directivity_f2(:));&#60;/p&#62;
&#60;p&#62;% compute relative angles from transducer&#60;br /&#62;
if strcmp(MASK_PLANE, 'xy')&#60;br /&#62;
    horz_axis = ((1:Ny) - Ny/2)*dy;&#60;br /&#62;
else&#60;br /&#62;
    horz_axis = ((1:Nz) - Nz/2)*dz;&#60;br /&#62;
end&#60;br /&#62;
angles = 180*atan2(horz_axis, transducer.focus_distance)/pi;&#60;/p&#62;
&#60;p&#62;% plot the directivity&#60;br /&#62;
figure;&#60;br /&#62;
plot(angles, directivity_f1, 'k-', angles, directivity_f2, 'k--');&#60;br /&#62;
axis tight;&#60;br /&#62;
set(gca, 'FontSize', 12);&#60;br /&#62;
xlabel('Angle [deg]');&#60;br /&#62;
ylabel('Normalised Amplitude');&#60;br /&#62;
legend('Fundamental', 'Second Harmonic', 'Location', 'NorthWest');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
