<?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: what the souce.p mean</title>
		<link>http://www.k-wave.org/forum/topic/what-the-soucep-mean</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:44:39 +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/what-the-soucep-mean" rel="self" type="application/rss+xml" />

		<item>
			<title>Yan on "what the souce.p mean"</title>
			<link>http://www.k-wave.org/forum/topic/what-the-soucep-mean#post-7416</link>
			<pubDate>Sat, 18 Apr 2020 15:17:12 +0000</pubDate>
			<dc:creator>Yan</dc:creator>
			<guid isPermaLink="false">7416@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Brad,&#60;br /&#62;
Your advice is very helpful. The source.p and source.p_mask has been assigned to the time varying signal and the binary distribution like disk, respectively. Now the simulation model is the one particle with a diameter of 100nm being illuminated by the different pulsewidth source of  26ps, 1ns and 9ns. The sensor frequency is 20000MHz to get the full frequency response, with the bandwidth equals to 80%.&#60;br /&#62;
However, I have encountered with some new problems when I try to compare the frequency spectrum of source with different pulsewidth. Actually, the time resolution of the sensor is approximately 1/( sensor frequency* bandwidth), about 62ps, which means the front and the back edge of 9ns has been clearly resolved by the sensor. The source.p is set below.&#60;br /&#62;
(1)	Consequently, the amplitude frequency spectrum of the 9ns has been split. Is there any reason why the frequency spectrum gets split? And is there any guidance you can give on the awkward situation caused by the sensor resolution and the relatively long pulse width like 9ns, so the effect of different pulse width on the frequency amplitude can be compared more intuitive?&#60;br /&#62;
(2)	Beside, when the front edge and the back one don’t split, the spectrum seems like the pulse response of the sensor. Is this reasonable?&#60;br /&#62;
(3)	Plus, it seems the PA signal in 2D with the souce.p I set is different from the PA signal with source.p0 (but the pulsewidth of souce.p0 can’t be changed ). The manual mentioned something with velocity. Is there any need to define the start velocity before the source.p set? If so, how can the velocity be defined? Or is it because the source.p is set as rectangular time series instead Gaussian?&#60;br /&#62;
Code Excerpt:&#60;br /&#62;
dx=20e-9&#60;br /&#62;
Nx=100&#60;br /&#62;
kgrid =kWaveGrid( Nx, dx, Nx, dx);&#60;br /&#62;
medium.sound_speed = 1500&#60;br /&#62;
disc_radius =round(50e-9/dx)&#60;br /&#62;
dt=0.3*dx/1500&#60;br /&#62;
pulse_width=(9e-9);% the defined pulsewidth like 26ps 1ns 9ns&#60;br /&#62;
Npulse=round(pulse_width/dt);&#60;br /&#62;
source1.p_mask=makeDisc( Nx, Nx, disc_y_pos,disc_z_pos , disc_radius);&#60;br /&#62;
source1.p= [zeros(1,10)  ones(1,Npulse)];&#60;br /&#62;
center_freq =20000e6;      % [Hz]&#60;br /&#62;
bandwidth = 80;         % [%]&#60;br /&#62;
sensor.frequency_response = [center_freq, bandwidth];&#60;br /&#62;
% input arguments&#60;br /&#62;
input_args = {'DisplayMask', source1.p_mask,'PMLInside',false, 'DataCast', 'single', 'CartInterp', 'nearest'};&#60;br /&#62;
sensor_data_pulse(1,:) = kspaceFirstOrder2D(kgrid, medium, source1, sensor, input_args{:});&#60;br /&#62;
sensor_hi_cen(1,:)=hilbert(sensor_data_pulse(1,:));%包络&#60;br /&#62;
[Fre_cen(1,:), sensor_data_as_cen(1,:)]= spect(sensor_data_pulse(1,:), 1/dt);%半边功率谱
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "what the souce.p mean"</title>
			<link>http://www.k-wave.org/forum/topic/what-the-soucep-mean#post-7224</link>
			<pubDate>Wed, 12 Feb 2020 15:53:20 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7224@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Yan,&#60;/p&#62;
&#60;p&#62;1) If you want to model an impulse (i.e., a photo acoustic source), then I'd suggest using source.p0. This takes care of the fact that the particle velocity is zero at t = 0. You can get the same behaviour with a time varying source, but need two clicks, i.e., source.p = [1, 1] (you also need to account for the scaling factor described in the manual).&#60;/p&#62;
&#60;p&#62;2) Set the source to the Gaussian. &#60;/p&#62;
&#60;p&#62;3) If your source has a rectangular envelope, then that sounds reasonable.&#60;/p&#62;
&#60;p&#62;4) The source mask has to be binary. If you want to apply apodisation, create a time varying source signal for each grid point that forms part of the source, and weight accordingly. Alternatively, given the short laser pulses, you could just assume stress confinement and use a p0 source, in which case you can apply the weighting directly to 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>Yan on "what the souce.p mean"</title>
			<link>http://www.k-wave.org/forum/topic/what-the-soucep-mean#post-7158</link>
			<pubDate>Wed, 25 Dec 2019 15:39:54 +0000</pubDate>
			<dc:creator>Yan</dc:creator>
			<guid isPermaLink="false">7158@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I am trying to use the k-wave toolbox to simulate the process between the beam excitation and the point sensor detection. However, I have encountered with several problems below. It would mean a lot if you can provide some of your insight.&#60;br /&#62;
（1）To get a pulse impulse, I try to get it in two way: first is a point source.p0 along with a point sensor, and the second way is to set a point source.p_mask with a point source.p=[1,0,0,…], together with a point sensor, too; Which of the two method is the right way to get a pulse impulse in your opinion?&#60;br /&#62;
（2）I want to simulate the process of a disk being irradiated by a 9ns and 1ns pulse beam respectively. The source.p_mask has been assigned to the disk. If the pulse is changed in gaussian shape and G= exp(-((kgrid.t_array-t_offset)/pulsewidth).^2)/(pulsewidth*sqrt(pi)), should I set ‘source.p=G’ or should I set ‘source.p=(the time derivation of G)’? I am a little confused by the reply on the forum.&#60;br /&#62;
（3）If the pulse is approximately like the rectangular pulse, could I simply set ‘source.p_mask=disk’ and ‘source.p=[1,..,1,0,0…0]’?  And is the number of 1 in source.p could be calculated through ‘number=9ns/dt’, where dt is the time step?&#60;br /&#62;
（4）Furthermore, if  I want to simulate the process of a disk being irradiated by a 9ns and 1ns pulse structural beam. Should the source.p_mask be assigned as ’ source.p_mask=disk.*structural pattern’ instead of ‘source.p_mask=disk’ on the condition that the structural beam is actually illuminated on the spatial distribution of the disk rather than temporal.&#60;/p&#62;
&#60;p&#62;Thank you!&#60;br /&#62;
Yan
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
