<?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: Theoretical amplitude of the reflected wave (when considering attenuation)</title>
		<link>http://www.k-wave.org/forum/topic/theoretical-amplitude-of-the-reflected-wave-when-considering-attenuation</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 08:28:09 +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/theoretical-amplitude-of-the-reflected-wave-when-considering-attenuation" rel="self" type="application/rss+xml" />

		<item>
			<title>saya mizutani on "Theoretical amplitude of the reflected wave (when considering attenuation)"</title>
			<link>http://www.k-wave.org/forum/topic/theoretical-amplitude-of-the-reflected-wave-when-considering-attenuation#post-8055</link>
			<pubDate>Sun, 07 Feb 2021 13:31:26 +0000</pubDate>
			<dc:creator>saya mizutani</dc:creator>
			<guid isPermaLink="false">8055@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi brad,&#60;/p&#62;
&#60;p&#62;I am trying to estimate reflectance from the reflected wave amplitude at each sensor, but it doesn't work.&#60;br /&#62;
I guess there is something wrong with my understanding of how to estimate the theoretical amplitude of reflective wave.&#60;/p&#62;
&#60;p&#62;I estimated the attenuated amplitude at each sensor as follows.&#60;/p&#62;
&#60;p&#62;% amplitude = (init*lss_b.*exp((-1).*medium.alpha_coeff*(1^(medium.alpha_power))*r))./sqrt(r)&#60;br /&#62;
% where,&#60;br /&#62;
% init  : The maximum amplitude of the incident waveform.&#60;br /&#62;
% lss_b : The optimal parameter for fitting the above formula&#60;br /&#62;
% r     : The wave propagation distance&#60;/p&#62;
&#60;p&#62;so the maximum amplitude of the reflective wave is&#60;/p&#62;
&#60;p&#62;% amplitude_reflect = (init*sqrt(R)*lss_b.*exp((-1).*medium.alpha_coeff*(1^(medium.alpha_power))*(rr)))./sqrt(rr)&#60;br /&#62;
% where,&#60;br /&#62;
% R = reflectance&#60;br /&#62;
% rr    : the wave propagation distance from the sound source to the sensors&#60;/p&#62;
&#60;p&#62;therefore, I can calculate the theoretical reflectance as below.&#60;/p&#62;
&#60;p&#62;% R = ((amp_ref*sqrt(rr)*exp(ave_coeff*(1^(medium.alpha_power))*(rr)))/(init*lss_b))^2;&#60;br /&#62;
% amp_ref : calculated amplitudes of returned waves&#60;/p&#62;
&#60;p&#62;Is there anything wrong with my theory about how much it attenuates?&#60;br /&#62;
Otherwise, is the source code for calculating the amplitude of reflected wave incorrect?&#60;/p&#62;
&#60;p&#62;Let me put my source code.&#60;br /&#62;
it includes some figures.&#60;/p&#62;
&#60;p&#62;Thanks in advance.&#60;/p&#62;
&#60;p&#62;Saya&#60;br /&#62;
******************************************************************************************************************&#60;br /&#62;
clear&#60;/p&#62;
&#60;p&#62;% make grid points&#60;br /&#62;
% Nx,Ny are even numbers&#60;br /&#62;
Nx = 896;           % number of grid points in the x (row) direction 448&#60;br /&#62;
Ny = 896;           % number of grid points in the y (column) direction 448&#60;br /&#62;
dx = 0.25e-3;        % grid point spacing in the x direction [m]、delta_x = 0.3[mm]&#60;br /&#62;
dy = 0.25e-3;        % grid point spacing in the y direction [m]、delta_y = 0.3[mm]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the medium conditions&#60;br /&#62;
Uppersoundspeed = ones(Nx/2,Ny) * 1540;&#60;br /&#62;
Undersoundspeed = ones(Nx/2,Ny) * 1450; % (1450～1650m/s)&#60;br /&#62;
medium.sound_speed = cat(1,Uppersoundspeed,Undersoundspeed);&#60;br /&#62;
medium.sound_speed_ref = 1540;&#60;br /&#62;
medium.density = 1050 * ones(Nx, Ny);       % [kg/m^3]&#60;br /&#62;
ave_coeff = 4.0237;&#60;br /&#62;
medium.alpha_coeff = ave_coeff * 0.08686 * ones(Nx,Ny);    % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_mode = 'no_dispersion';&#60;br /&#62;
medium.alpha_power = 1.01;&#60;/p&#62;
&#60;p&#62;% make time array&#60;br /&#62;
% t_end should be longer than Nx*dx/slowest_sound_speed&#60;br /&#62;
t_end = 3e-4;            % [s]&#60;br /&#62;
cfl = 1540*4*10^(-8)/dx;   % the basical sound speed is 1540 [m/s]&#60;br /&#62;
kgrid.makeTime(1540,cfl,t_end);&#60;br /&#62;
dt_stability_limit = checkStability(kgrid, medium); % Compute maximum stable time step for k-space fluid models.&#60;/p&#62;
&#60;p&#62;if dt_stability_limit &#38;lt; kgrid.dt&#60;br /&#62;
    msg = 'kgrid.dt must be smaller than dt_stability_limit.';&#60;br /&#62;
    error(msg);&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% define the sound source&#60;br /&#62;
smask = zeros(Nx,Ny);&#60;br /&#62;
source_grid_x = 40;&#60;br /&#62;
source_grid_y = Ny/2;&#60;br /&#62;
smask(source_grid_x,source_grid_y)=1;&#60;br /&#62;
source.p_mask = smask;&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
tone_burst_freq = 1e6;        % [Hz]&#60;br /&#62;
tone_burst_cycles = 5;&#60;br /&#62;
sampling_freq = 1/kgrid.dt;&#60;br /&#62;
toneBurst(sampling_freq, tone_burst_freq, tone_burst_cycles, 'Plot', false);&#60;br /&#62;
source.p = toneBurst(sampling_freq, tone_burst_freq, tone_burst_cycles);&#60;br /&#62;
initial_source = source.p;&#60;/p&#62;
&#60;p&#62;% filter the signal&#60;br /&#62;
% add zeros for filtering&#60;br /&#62;
extend = zeros(1,200);&#60;br /&#62;
source_in = cat(2,source.p,extend);&#60;br /&#62;
filtered_signal = filterTimeSeries(kgrid, medium, source_in);&#60;br /&#62;
cut_filtered_signal = zeros(1,141);&#60;br /&#62;
for cu = 1:139&#60;br /&#62;
    cut_filtered_signal(1,cu+1) = filtered_signal(1,30+cu) ;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% make the maximum signal envelope one&#60;br /&#62;
[Max_source,~] = max(envelopeDetection(cut_filtered_signal));&#60;br /&#62;
source_strength = 1/Max_source;          % [Pa]&#60;br /&#62;
source.p =  source_strength .* cut_filtered_signal;&#60;br /&#62;
[max_source,index_source] = max(envelopeDetection(source.p));&#60;/p&#62;
&#60;p&#62;% define the sensors&#60;br /&#62;
sp = zeros(Nx,Ny);&#60;br /&#62;
num_sensor = 0;&#60;br /&#62;
for i = source_grid_x:Nx&#60;br /&#62;
    sp(i,Ny/2) = 1;&#60;br /&#62;
    num_sensor = num_sensor + 1;&#60;br /&#62;
end&#60;br /&#62;
sensor.mask = sp;&#60;/p&#62;
&#60;p&#62;% run the simulation using GPU&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, ...&#60;br /&#62;
    'PlotLayout', true, 'PlotPML', false, 'RecordMovie',false,'PlotSim',false,'DataCast','gpuArray-single');&#60;br /&#62;
sensor_data = gather(sensor_data);&#60;/p&#62;
&#60;p&#62;% visualize the initial source&#60;br /&#62;
figure;plot(envelopeDetection(sensor_data(1,:)))&#60;br /&#62;
xlim([0 1000])&#60;br /&#62;
title('Incident waveform')&#60;br /&#62;
yline(max(envelopeDetection(sensor_data(1,:))))&#60;br /&#62;
dim = [.2 .55 .3 .3];&#60;br /&#62;
v = max(envelopeDetection(sensor_data(1,:)));&#60;br /&#62;
str = ['Maximum amplitude is',num2str(v)];&#60;br /&#62;
annotation('textbox',dim,'String',str,'FitBoxToText','on');&#60;/p&#62;
&#60;p&#62;% Initial amplitude error&#60;br /&#62;
init = max(envelopeDetection(sensor_data(1,:)));&#60;br /&#62;
error_init = 1 - init;&#60;br /&#62;
[cart_source, ~] = grid2cart(kgrid, smask);&#60;br /&#62;
[cart_sensor, order_sensor] = grid2cart(kgrid, sp);&#60;br /&#62;
amp = ones(num_sensor,1);&#60;br /&#62;
r = zeros(num_sensor,1);&#60;br /&#62;
for j = 1:num_sensor&#60;br /&#62;
    amp(j,1) = max(envelopeDetection(sensor_data(j,:)));&#60;br /&#62;
    r(j,1) = sqrt((cart_source(1,1)-cart_sensor(1,j))^2+(cart_source(2,1)-cart_sensor(2,j))^2);&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% Find the optimal parameter b（lss_b）&#60;br /&#62;
lss = [0,num_sensor];&#60;br /&#62;
lss_b = 0;&#60;br /&#62;
for b = 0.0001:0.0001:0.1&#60;br /&#62;
    lss(1) = 0;&#60;br /&#62;
    % Ignore the case k=1 (because lss(1)=Inf in case k=1)&#60;br /&#62;
    for k = 2:num_sensor&#60;br /&#62;
        lss(1) = lss(1) + ((init * b * exp((-1)*ave_coeff*(1^(medium.alpha_power))*r(k,1)))/sqrt(r(k,1)) - amp(k,1))^2;&#60;br /&#62;
    end&#60;br /&#62;
    if lss(2)&#38;gt;lss(1)&#60;br /&#62;
        lss(2) = lss(1);&#60;br /&#62;
        lss_b = b;&#60;br /&#62;
    end&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% Visualize the propagation wave amplitude&#60;br /&#62;
figure;&#60;br /&#62;
plot(amp,'.');&#60;br /&#62;
hold on&#60;br /&#62;
p = 1:num_sensor;&#60;br /&#62;
plot(p,(init*lss_b.*exp((-1).*ave_coeff*(1^(medium.alpha_power))*r))./sqrt(r)); % 1MHz&#60;br /&#62;
title('Calculated and theoretical values of amplitude')&#60;br /&#62;
xlabel('Distance from sound source [mm]');&#60;br /&#62;
ylabel('Amplitude');&#60;br /&#62;
legend('Calculated values','Theoretical values')&#60;br /&#62;
xticks([0 100 200 300 400 500 600 700 800 900])&#60;br /&#62;
xticklabels({'0','25','50','75','100','125','150','175','200','225'})&#60;br /&#62;
hold off&#60;/p&#62;
&#60;p&#62;% Get the index that maximizes the envelope of the transmitted wave&#60;br /&#62;
[~,index_sourcemax] = max(envelopeDetection(sensor_data(1,:)));&#60;br /&#62;
% Extract the amplitude of the reflected wave selectively&#60;br /&#62;
% 1. Calculate the time when the reflected wave returns (time_ref)&#60;br /&#62;
% 2. Get the amplitude at that time (amp_ref)&#60;br /&#62;
% dist_ref(rr1) : Distance from sound source to reflective surface&#60;br /&#62;
% rr : Sound wave propagation distance until the transmitted wave from the sound source is reflected by the reflecting surface and passes through the sensor again&#60;br /&#62;
rr = zeros(Nx/2-source_grid_x+1,1);&#60;br /&#62;
center = zeros(Nx,Ny);&#60;br /&#62;
center(Nx/2,Ny/2) = 1;&#60;br /&#62;
[cart_center, ~] = grid2cart(kgrid, center);&#60;br /&#62;
dist_ref = sqrt((cart_source(1,1)-cart_center(1,1))^2+(cart_source(2,1)-cart_center(2,1))^2);&#60;br /&#62;
time_ref = zeros(Nx/2-source_grid_x+1,1);&#60;br /&#62;
cut_sensor_data = zeros(Nx/2-source_grid_x+1,201);&#60;br /&#62;
amp_ref = zeros(Nx/2-source_grid_x+1,1);&#60;br /&#62;
count = 0;&#60;br /&#62;
for rri = 1:Nx/2-source_grid_x+1&#60;br /&#62;
    rr(rri,1) = dist_ref + dist_ref - r(rri,1);&#60;br /&#62;
    time_ref(rri,1) = rr(rri,1)/(1540*kgrid.dt);&#60;br /&#62;
    for cri = round(time_ref(rri,1)):round(time_ref(rri,1)+200)&#60;br /&#62;
        count = count + 1;&#60;br /&#62;
        cut_sensor_data(rri,count) = sensor_data(rri,cri);&#60;br /&#62;
    end&#60;br /&#62;
    count = 0;&#60;br /&#62;
    amp_ref(rri,1) = max(envelopeDetection(cut_sensor_data(rri,:)));&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% Find the theoretical reflectance&#60;br /&#62;
Ref_theory = abs((max(max(Uppersoundspeed)) - max(max(Undersoundspeed)))/(max(max(Uppersoundspeed)) + max(max(Undersoundspeed))));&#60;/p&#62;
&#60;p&#62;% Estimate reflectance by reflected waves&#60;br /&#62;
estimation_ref = zeros(Nx/2-source_grid_x+1,1);&#60;br /&#62;
for ei = 1:Nx/2-source_grid_x+1&#60;br /&#62;
    estimation_ref(ei,1) = ((amp_ref(ei,1)*sqrt(rr(ei,1))*exp(ave_coeff*(1^(medium.alpha_power))*(rr(ei,1))))/(init*lss_b))^2;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% Visualize the Estimated reflectances and Theoretical reflectances at each sensor&#60;br /&#62;
figure;&#60;br /&#62;
plot(estimation_ref(1:177,1));&#60;br /&#62;
hold on&#60;br /&#62;
title(['Reflectance _ Initialsoundspeed ',num2str(max(max(Undersoundspeed))),'[m/s]_ the other ',num2str(max(max(Uppersoundspeed))),'[m/s]'])&#60;br /&#62;
yline(Ref_theory);&#60;br /&#62;
legend({'Estimated reflectance','Theoretical reflectance'})&#60;br /&#62;
hold off&#60;/p&#62;
&#60;p&#62;% Visualize the estimation error in each case&#60;br /&#62;
figure;&#60;br /&#62;
diff = Ref_theory - estimation_ref;&#60;br /&#62;
plot(diff(1:177,1));&#60;br /&#62;
title('Difference between ideal reflectance and estimated reflectance due to error');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
