<?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: various input signal</title>
		<link>http://www.k-wave.org/forum/topic/various-input-signal</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:29:01 +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/various-input-signal" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5304</link>
			<pubDate>Fri, 06 Nov 2015 22:41:58 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5304@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Kamal,&#60;/p&#62;
&#60;p&#62;Exactly what part of the output signal are you concerned about? At each edge of the square wave, you will generate a photoacoustic pulse, with the signal from the second edge the opposite polarity from the signal from the first edge. The shape of these signals in 2D is given by your first simulation (see also the &#60;a href=&#34;http://www.k-wave.org/documentation/example_ivp_photoacoustic_waveforms.php&#34;&#62;Photoacoustic Waveforms in 1D, 2D and 3D Example&#60;/a&#62;).&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jnawali123@gmail.com on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5296</link>
			<pubDate>Sat, 24 Oct 2015 17:05:15 +0000</pubDate>
			<dc:creator>jnawali123@gmail.com</dc:creator>
			<guid isPermaLink="false">5296@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks Brad&#60;/p&#62;
&#60;p&#62;I have a problem in the following code, for the rectangular pulse, i am getting unusual output pressure signal, i am running it to test for various kind of signal input. Can i apply similar technique for the chirp signal.&#60;br /&#62;
Here is my code for the rect as the input function.&#60;/p&#62;
&#60;p&#62;clear all&#60;br /&#62;
close all&#60;br /&#62;
sensor_radius = 2e-3; %[m]point sensor kept at a distance of 2 mm from the centre of the source.&#60;br /&#62;
ball_radius = 1e-3; %[m]source is a spherical ball of radius 1 mm.&#60;br /&#62;
pulsewidth_min = 0.1e-6; %min width of the pulse which excites the source.&#60;/p&#62;
&#60;p&#62;%-------------------------------------------------------------------------------&#60;br /&#62;
%create the computational grid&#60;br /&#62;
%-------------------------------------------------------------------------------&#60;br /&#62;
%makeGrid(Nx,dx,Ny,dy)&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
dx = 0.025e-3;    	% grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;            % grid point spacing in the y direction [m]&#60;br /&#62;
PMLe = 25*dx; %[no of grid points for PML*dx]&#60;br /&#62;
grig_length = (2*sensor_radius)+(2*PMLe); % total grid length in a particular direction [m]&#60;br /&#62;
Nx = grig_length/dx;    % number of grid points in the x (row) direction&#60;br /&#62;
Ny = grig_length/dx;    % number of grid points in the y (column) direction&#60;br /&#62;
%the nyquist requires two point per wavelength is necessary if we need to take&#60;br /&#62;
% x_size instead of Nx (then look details in the page 28)&#60;br /&#62;
kgrid=makeGrid(Nx,dx,Ny,dy);&#60;br /&#62;
% to see maximum spatial frequency type kgrid.k_max(details in the page 28)&#60;br /&#62;
%see how kspace looks like %imshow(kgrid.k,[])&#60;br /&#62;
% to make faster computation, grid points in the form of 2^(power)&#60;/p&#62;
&#60;p&#62;%--------------------------------------------------------------------------&#60;br /&#62;
%define the material property&#60;br /&#62;
%----------------------------------------------------------------------------&#60;/p&#62;
&#60;p&#62;medium.sound_speed=1500;&#60;/p&#62;
&#60;p&#62;%--------------------------------------------------------------------------------&#60;br /&#62;
%time array&#60;br /&#62;
%---------------------------------------------------------------------------------&#60;br /&#62;
% if we need to set the final time&#60;br /&#62;
%kgrid.t_array=makeTime(kgrid,medium.sound_speed,[],t_end]&#60;br /&#62;
time.dt = pulsewidth_min/10;    % sampling interval[s]&#60;br /&#62;
time.total =  6e-6 + sensor_radius/medium.sound_speed; % Total simulation time or the time taken by the wave to reach the transducer[s]&#60;br /&#62;
time.Nt = ceil(time.total/time.dt); % No of time steps[points]&#60;br /&#62;
time.t_array = 0:1:time.Nt-1; %time array having Nt time steps&#60;br /&#62;
time.t_array = time.t_array*time.dt;&#60;br /&#62;
kgrid.t_array=time.t_array;&#60;br /&#62;
%----------------------------------------------------------------------------------&#60;br /&#62;
%define the source pressure(requires sourc.p_mask and source.p&#60;br /&#62;
%----------------------------------------------------------------------------------&#60;br /&#62;
%--------------------------------------------------------------------------------&#60;br /&#62;
%source.p_mask&#60;br /&#62;
%---------------------------------------------------------------------------------------&#60;br /&#62;
% source.p_mask = zeros(Nx, Ny);&#60;br /&#62;
% source.p_mask(Nx/5, Ny/2) = 1;&#60;/p&#62;
&#60;p&#62;% create initial pressure distribution using makeDisc&#60;br /&#62;
disc_magnitude = 1; % [au]&#60;br /&#62;
disc_x_pos = Nx/2;    % [grid points]&#60;br /&#62;
disc_y_pos = Ny/2;    % [grid points]&#60;br /&#62;
disc_radius = 10;    % [grid points]&#60;br /&#62;
disc_1 = disc_magnitude*makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);&#60;br /&#62;
source.p_mask = disc_1;&#60;br /&#62;
%--------------------------------------------------------------------------------&#60;br /&#62;
%source.p for variable input signal&#60;br /&#62;
%---------------------------------------------------------------------------------------&#60;br /&#62;
pulse_width = [0.1e-6 0.2e-6 0.5e-6 1e-6 2e-6 4e-6];% array of the various pulse widths&#60;br /&#62;
% define a gaussian pulse source&#60;/p&#62;
&#60;p&#62;for i=1:length(pulse_width)&#60;/p&#62;
&#60;p&#62;% a=1e-6;&#60;br /&#62;
% b=a+pulse_width(i);&#60;br /&#62;
%source.p=rectangularPulse(a,b,kgrid.t_array);&#60;br /&#62;
source.p=rectpuls(kgrid.t_array,pulse_width(i));&#60;/p&#62;
&#60;p&#62;%filter the source to remove high frequencies not supported by the grid&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;%--------------------------------------------------------------------------------&#60;br /&#62;
%define sensor&#60;br /&#62;
%-------------------------------------------------------------------------------&#60;br /&#62;
sensor.mask=zeros(Nx,Ny);&#60;br /&#62;
sensor.mask(Nx/5,Ny/2)=1;&#60;/p&#62;
&#60;p&#62;%---------------------------------------------------------------------------------&#60;br /&#62;
%run simulation&#60;br /&#62;
%--------------------------------------------------------------------------------------&#60;br /&#62;
sensor.record={'p','p_final'};&#60;/p&#62;
&#60;p&#62;sensor_data=kspaceFirstOrder2D(kgrid, medium, source, sensor);%,'PlotScale',[-10 ,10]);&#60;/p&#62;
&#60;p&#62;%--------------------------------------------------------------------------&#60;br /&#62;
%results&#60;br /&#62;
%plot the final wave-field&#60;br /&#62;
%--------------------------------------------------------------------------&#60;br /&#62;
%&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(kgrid.y_vec*1e3, kgrid.x_vec*1e3, sensor_data.p_final + source.p_mask + sensor.mask, [-1 1]);&#60;br /&#62;
colormap(getColorMap);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
xlabel('y-position [mm]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;% plot the simulated sensor data&#60;br /&#62;
figure;&#60;br /&#62;
[t_sc, scale, prefix] = scaleSI(max(kgrid.t_array(:)));&#60;/p&#62;
&#60;p&#62;subplot(2, 1, 1), plot(kgrid.t_array*scale, source.p, 'k-');&#60;br /&#62;
xlabel(['Time [' prefix 's]']);&#60;br /&#62;
ylabel('Signal Amplitude');&#60;br /&#62;
axis tight;&#60;br /&#62;
title('Input Pressure Signal');&#60;/p&#62;
&#60;p&#62;subplot(2, 1, 2), plot(kgrid.t_array*scale, sensor_data.p, 'r-');&#60;br /&#62;
xlabel(['Time [' prefix 's]']);&#60;br /&#62;
ylabel('Signal Amplitude');&#60;br /&#62;
axis tight;&#60;br /&#62;
title('Sensor Pressure Signal');&#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;Kamal Jnawali
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5295</link>
			<pubDate>Sat, 24 Oct 2015 07:08:58 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5295@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi jnawali123,&#60;/p&#62;
&#60;p&#62;Do you mean the plot during the simulation, or when you plot the returned &#60;code&#62;sensor_data&#60;/code&#62;? The &#60;code&#62;&#38;#39;PlotScale&#38;#39;&#60;/code&#62; input only controls the plot scale used during the simulation.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jnawali123@gmail.com on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5292</link>
			<pubDate>Fri, 23 Oct 2015 18:34:09 +0000</pubDate>
			<dc:creator>jnawali123@gmail.com</dc:creator>
			<guid isPermaLink="false">5292@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks Anthony&#60;br /&#62;
Yes the book is really good i have a trouble to apply&#60;br /&#62;
sensor_data=kspaceFirstOrder2D(kgrid, medium, source, sensor,'PlotScale',[-10 ,10]);&#60;br /&#62;
it doesnot give me the output plot with range -10 to 10
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anthony on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5279</link>
			<pubDate>Tue, 20 Oct 2015 07:53:18 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">5279@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi jnawali123,&#60;/p&#62;
&#60;p&#62;You can set the input signal with the variable &#60;code&#62;source.p&#60;/code&#62;.&#60;br /&#62;
I encourage you to read the user manual (see documentation) and to check the examples, they will help you. Feel free to ask if you have specific questions (you can even post a minimum working example if you have problems).&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Anthony
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jnawali123@gmail.com on "various input signal"</title>
			<link>http://www.k-wave.org/forum/topic/various-input-signal#post-5276</link>
			<pubDate>Sat, 17 Oct 2015 02:08:51 +0000</pubDate>
			<dc:creator>jnawali123@gmail.com</dc:creator>
			<guid isPermaLink="false">5276@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I want to apply the sin and chip signal at the source input . i am new to k wave and doing the simulation to see the nature of the output signal.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
