<?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: Trying to Model a single element US with a frequency of 10 MHz</title>
		<link>http://www.k-wave.org/forum/topic/trying-to-model-a-single-element-us-with-a-frequency-of-10-mhz</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 14:19:28 +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/trying-to-model-a-single-element-us-with-a-frequency-of-10-mhz" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Trying to Model a single element US with a frequency of 10 MHz"</title>
			<link>http://www.k-wave.org/forum/topic/trying-to-model-a-single-element-us-with-a-frequency-of-10-mhz#post-6841</link>
			<pubDate>Wed, 10 Apr 2019 13:48:07 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6841@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi douavang96,&#60;/p&#62;
&#60;p&#62;The scatterer is very small compared to the wavelength, and the contrast is reasonably weak. My guess is that it's just acoustically transparent within the accuracy of the simulation (governed by the accuracy of the PML). What if you try increasing the size of the scatterer relative to the wavelength, or increasing the contrast?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>douavang96 on "Trying to Model a single element US with a frequency of 10 MHz"</title>
			<link>http://www.k-wave.org/forum/topic/trying-to-model-a-single-element-us-with-a-frequency-of-10-mhz#post-6828</link>
			<pubDate>Mon, 08 Apr 2019 18:43:30 +0000</pubDate>
			<dc:creator>douavang96</dc:creator>
			<guid isPermaLink="false">6828@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am using the ultrasound B-Mode images example as a base to create my simulation. I have a single point transducer with multiple point targets. I have successfully simulated a situation with a input signal of 1 MHz with the grid size in the 100 um scale. However, I am not getting the same good results when I change the input signal to 10 MHz. Meaning the received input signal may not be the frequency i set and I am not getting any reflected signal. I have modified the grid size, smaller grid size, to allow for a larger maximum allowed frequency. My code is below and any help is appreciated.&#60;/p&#62;
&#60;p&#62;%% Initialization &#60;/p&#62;
&#60;p&#62;clearvars;&#60;/p&#62;
&#60;p&#62;% simulation settings&#60;br /&#62;
DATA_CAST = 'single';&#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 = 10;            % [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;
gp = 64;&#60;br /&#62;
Nx = gp - 2*PML_X_SIZE;    % [grid points]&#60;br /&#62;
Ny = gp - 2*PML_Y_SIZE;    % [grid points]&#60;br /&#62;
Nz = gp - 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 = Nx*1e-5;                  % [m]&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = x/Nx;                  % [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 = kWaveGrid(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&#60;br /&#62;
c0 = 1540;                      % [m/s]&#60;br /&#62;
rho0 = 1000;                    % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.75;      % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.BonA = 6;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t_end = (Nx * dx) * 2.4 / c0;   % [s]&#60;br /&#62;
kgrid.makeTime(c0, [], t_end);&#60;br /&#62;
% fs =100e6;&#60;br /&#62;
% dt = 1/fs;&#60;br /&#62;
% Nt = round(t_end/dt);&#60;br /&#62;
% kgrid.setTime(Nt, dt)&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define a large image size to move across&#60;br /&#62;
Nx_tot = Nx;&#60;br /&#62;
Ny_tot = Ny;&#60;br /&#62;
Nz_tot = Nz;&#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 = 10e6;        % [Hz]&#60;br /&#62;
tone_burst_cycles = 1;&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles,'Plot',true,'SignalLength',20);&#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 ./ (c0 * rho0)) .* input_signal;&#60;/p&#62;
&#60;p&#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 = 1;       % width of each element [grid points]&#60;br /&#62;
transducer.element_length = 1;  	% 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;
% transducer.radius = 20e-3;            % radius of curvature of the transducer [m]&#60;/p&#62;
&#60;p&#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;/p&#62;
&#60;p&#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 = c0;                    % sound speed [m/s]&#60;br /&#62;
focus = x*10;&#60;br /&#62;
transducer.focus_distance = focus;              % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = focus;    % focus distance in the elevation plane [m]&#60;br /&#62;
transducer.steering_angle = 0;                  % steering angle [degrees]&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;br /&#62;
number_active_elements = 1;&#60;br /&#62;
transducer.active_elements = ones(transducer.number_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 = kWaveTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62;% print out transducer properties&#60;br /&#62;
%transducer.properties;&#60;/p&#62;
&#60;p&#62;%% run the simulation&#60;/p&#62;
&#60;p&#62;% set the input settings&#60;br /&#62;
input_args = {...&#60;br /&#62;
    'PMLInside', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotSim', true};&#60;/p&#62;
&#60;p&#62;% scattering_region3 = zeros(Nx_tot,Ny_tot,Nz_tot);&#60;br /&#62;
% sound_speed_map = c0 * ones(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
% density_map = rho0 * ones(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
% medium.sound_speed = sound_speed_map;&#60;br /&#62;
% medium.density = density_map;&#60;br /&#62;
%&#60;br /&#62;
% sensor_blank = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
% figure;plot(kgrid.t_array,sensor_blank)&#60;br /&#62;
% title('Blank Data')&#60;br /&#62;
% xlabel('time (s)'),ylabel('recorded pressure');&#60;/p&#62;
&#60;p&#62;%     sensor_data(i+3,:) = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;/p&#62;
&#60;p&#62;n = 1;&#60;br /&#62;
maxLine = 1;&#60;br /&#62;
for i= 1:maxLine&#60;/p&#62;
&#60;p&#62;    scattering_region3 = zeros(Nx_tot,Ny_tot,Nz_tot);&#60;br /&#62;
    scattering_region3(10, Ny/2+(i-(maxLine+1)/2), Nz/2) = 1;&#60;br /&#62;
    scattering_region3(20, Ny/2+(i-(maxLine+1)/2), Nz/2) = 1;&#60;br /&#62;
%     scattering_region3(30, Ny/2+(i-(maxLine+1)/2), Nz/2) = 1;&#60;br /&#62;
%     scattering_region3(Nx, Ny/2+(i-(maxLine+1)/2), Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;    sound_speed_map = c0 * ones(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
    density_map = rho0 * ones(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
    sound_speed_map(scattering_region3 == 1) = 1600;&#60;br /&#62;
    density_map(scattering_region3 == 1) = 1200;&#60;br /&#62;
    medium.sound_speed = sound_speed_map;&#60;br /&#62;
    medium.density = density_map;&#60;/p&#62;
&#60;p&#62;    sensor_data(n,:) = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;/p&#62;
&#60;p&#62;    n = n+1;&#60;/p&#62;
&#60;p&#62;%     % test sensor&#60;br /&#62;
%     sensor.mask = scattering_region3;&#60;br /&#62;
%     sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;%%&#60;br /&#62;
figure&#60;br /&#62;
plot(kgrid.t_array,sensor_data);%ylim([-50 50]);&#60;br /&#62;
title('Sensor Data')&#60;br /&#62;
xlabel('time (s)'),ylabel('recorded pressure');%ylim(1e4*[-1.2 1.2])&#60;/p&#62;
&#60;p&#62;%% =========================================================================&#60;br /&#62;
% PROCESS THE RESULTS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% -----------------------------&#60;br /&#62;
% Remove Input Signal&#60;br /&#62;
% -----------------------------&#60;/p&#62;
&#60;p&#62;% create a window to set the first part of each scan line to zero to remove&#60;br /&#62;
% interference from the input signal&#60;br /&#62;
scan_line_win = getWin(kgrid.Nt * 2, 'Tukey', 'Param', 0.05).';&#60;br /&#62;
scan_line_win = [zeros(1, round(length(input_signal) * 2)),...&#60;br /&#62;
scan_line_win(1:end/2 - round(length(input_signal) * 2))];&#60;/p&#62;
&#60;p&#62;% apply the window to each of the scan lines&#60;br /&#62;
scan_line1 = bsxfun(@times, scan_line_win, sensor_data);&#60;br /&#62;
figure&#60;br /&#62;
plot(kgrid.t_array,scan_line1)&#60;br /&#62;
title('Scan Line1')&#60;br /&#62;
xlabel('time (s)');ylabel('Pressure');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
