<?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: Chirp and deconvolution</title>
		<link>http://www.k-wave.org/forum/topic/chirp-and-deconvolution</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:32:41 +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/chirp-and-deconvolution" rel="self" type="application/rss+xml" />

		<item>
			<title>tiagodourado on "Chirp and deconvolution"</title>
			<link>http://www.k-wave.org/forum/topic/chirp-and-deconvolution#post-6299</link>
			<pubDate>Wed, 21 Feb 2018 04:22:50 +0000</pubDate>
			<dc:creator>tiagodourado</dc:creator>
			<guid isPermaLink="false">6299@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Follow the script:&#60;/p&#62;
&#60;p&#62;clear all;&#60;br /&#62;
close all;&#60;br /&#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;
Nx = 1024 ;  %&#60;br /&#62;
dx = 1e-3;   %&#60;br /&#62;
Ld = 300;    %&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx); &#60;/p&#62;
&#60;p&#62;posTransm = (Nx-Ld)/2;&#60;br /&#62;
posRecep = posTransm + Ld;                 &#60;/p&#62;
&#60;p&#62;medium.sound_speed = 1500 * ones(Nx, 1);&#60;br /&#62;
medium.sound_speed(posTransm:posRecep)=4000;&#60;br /&#62;
medium.density = 1000 * ones(Nx,1);&#60;br /&#62;
medium.density(posTransm:posRecep)= 2200;&#60;/p&#62;
&#60;p&#62;t_end = kgrid.x_size / max(medium.sound_speed(:));&#60;/p&#62;
&#60;p&#62;dt=75e-9;&#60;br /&#62;
Fs=1/dt;&#60;br /&#62;
Fmin = 1e5;&#60;br /&#62;
Fmax = 5e5;&#60;br /&#62;
Lch = 255;&#60;br /&#62;
Tfin = Lch*dt;&#60;br /&#62;
EixoT = (0:dt:Tfin);&#60;br /&#62;
ch = chirp(EixoT, Fmin, Tfin, Fmax);&#60;/p&#62;
&#60;p&#62;%Apply Gaussian filter that simule effect of transducer&#60;br /&#62;
%ch = gaussianFilter(ch, Fs, 3e5, 10);&#60;/p&#62;
&#60;p&#62;%Define source location&#60;br /&#62;
source.p_mask=zeros(Nx,1);&#60;br /&#62;
source.p_mask(posTransm)=1; %&#60;br /&#62;
source.p = ch;&#60;/p&#62;
&#60;p&#62;%Define receiver location&#60;br /&#62;
sensor.mask = zeros(Nx,1);&#60;br /&#62;
sensor.mask(posTransm) = 1;&#60;br /&#62;
sensor.mask(posRecep) = 1&#60;br /&#62;
%sensor.mask = [-150e-3, 150e-3];  % [mm]&#60;br /&#62;
kgrid.t_array = makeTime(kgrid,medium.sound_speed(:),[],t_end);&#60;/p&#62;
&#60;p&#62;% Run model&#60;br /&#62;
sensor_data = kspaceFirstOrder1D(kgrid, medium, source, sensor, 'PlotLayout', true, 'Smooth', [false, false, false]);&#60;/p&#62;
&#60;p&#62;R1=(sensor_data(1, :)); % Output of R1&#60;br /&#62;
R2=(sensor_data(2, :)); % Output of R2&#60;/p&#62;
&#60;p&#62;% Apply low pass filter&#60;br /&#62;
%R1 = applyFilter(R1, 1/dt, 7.5e5, 'LowPass', 'Plot', false, 'ZeroPhase', true);&#60;br /&#62;
%R2 = applyFilter(R2, 1/dt, 7.5e5, 'LowPass', 'Plot', false, 'ZeroPhase', true);&#60;/p&#62;
&#60;p&#62;disp('Fill signal length with extra zeros up to 2 power closer')&#60;br /&#62;
tam=2^(ceil(log2(length(R1)))); %&#60;br /&#62;
EixoS = (dt:dt:dt*(tam));%&#60;br /&#62;
%R1p = [zeros(length(ch),1);R1';zeros(tam-length(ch)-length(R1),1)];&#60;br /&#62;
%R2p = [zeros(length(ch),1);R2';zeros(tam-length(ch)-length(R2),1)];&#60;br /&#62;
%%Without moving the beginning of strokes with zeros&#60;br /&#62;
R1p = [R1';zeros(tam-length(R1),1)];&#60;br /&#62;
R2p = [R2';zeros(tam-length(R2),1)];&#60;/p&#62;
&#60;p&#62;chlong = [ch';zeros(tam-(length(ch)),1)];&#60;br /&#62;
%chlong = [zeros(length(ch),1);ch1';zeros(tam-2*(length(ch)),1)];&#60;/p&#62;
&#60;p&#62;%TF_R1=fft(R1p);  % FFT in R1&#60;br /&#62;
%TF_R2=fft(R2p);  % FFT in R2&#60;br /&#62;
%TF_ch = fft(chlong); % FFT in chirp&#60;br /&#62;
%R1c = real(ifft(TF_R1/TF_ch)); % Deconvolution R1&#60;br /&#62;
%R2c = real(ifft(TF_R2/TF_ch)); % Deconvolution R2&#60;br /&#62;
R1c = real(ifft(fft(R1p)./fft(chlong)));&#60;br /&#62;
R2c = real(ifft(fft(R2p)./fft(chlong)));&#60;br /&#62;
[q1,r1] = deconv(R1,chlong)&#60;/p&#62;
&#60;p&#62;% Apply low pass filter&#60;br /&#62;
%R1c = applyFilter(R1c, 1/dt, 7.5e5, 'LowPass', 'Plot', false, 'ZeroPhase', true);&#60;br /&#62;
%R2c = applyFilter(R2c, 1/dt, 7.5e5, 'LowPass', 'Plot', false, 'ZeroPhase', true);&#60;/p&#62;
&#60;p&#62;% -------------------------------------------------------------------------&#60;br /&#62;
% Plot results&#60;br /&#62;
% -------------------------------------------------------------------------&#60;br /&#62;
figure;&#60;br /&#62;
subplot(2, 1, 1);&#60;br /&#62;
plot (EixoS,R1c,EixoS,R1p);&#60;br /&#62;
legend('Signal R1 and Deconvolved');&#60;br /&#62;
ylabel('Power');&#60;br /&#62;
xlabel('Time (us)')&#60;br /&#62;
grid minor;&#60;br /&#62;
hold on;&#60;/p&#62;
&#60;p&#62;subplot(2, 1, 2);&#60;br /&#62;
plot (EixoS,R2c,EixoS,R2p)&#60;br /&#62;
legend('Signal R2 and Deconvolved');&#60;br /&#62;
ylabel('Power');&#60;br /&#62;
xlabel('Time(us)');&#60;br /&#62;
grid minor;&#60;/p&#62;
&#60;p&#62;% Show specters&#60;br /&#62;
[output1, as_input1] = spect(R1, Fs, 'Plot', [true,false]);&#60;br /&#62;
[output2, as_input2] = spect(R2, Fs, 'Plot', [true,false]);&#60;br /&#62;
[Deconvolved1, as_input3] = spect(R1c, Fs, 'Plot', [true,false]);&#60;br /&#62;
[Deconvolved2, as_input4] = spect(R2c, Fs, 'Plot', [true,false]);&#60;br /&#62;
[chirp, as_input5] = spect(ch,Fs, 'Plot', [true,false]);&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
plot (output1/1e6, as_input1./max(as_input1(:)),output2/1e6, as_input2./max(as_input2(:)), Deconvolved1/1e6, as_input3./max(as_input3(:)),Deconvolved2/1e6, as_input4./max(as_input4(:)), chirp/1e6, as_input5./max(as_input5(:)));&#60;br /&#62;
title('Normalized frequency spectrum soon after reading signals');&#60;br /&#62;
legend('output1','output2','Deconvolved1','Deconvolved2','chirp');&#60;br /&#62;
set(gca, 'XLim', [0, 2]);&#60;br /&#62;
grid minor;&#60;br /&#62;
ylabel('Power');&#60;br /&#62;
xlabel('Frequency (MHz)');&#60;/p&#62;
&#60;p&#62;%% THE DOUBT IS WHY THE SPECTRUM AFTER DECONVOLUTION IS SO DIFFERENT OF BEFORE.&#60;/p&#62;
&#60;p&#62;Thanks for reading.&#60;/p&#62;
&#60;p&#62;Tiago Dourado
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tiagodourado on "Chirp and deconvolution"</title>
			<link>http://www.k-wave.org/forum/topic/chirp-and-deconvolution#post-6291</link>
			<pubDate>Mon, 19 Feb 2018 03:09:14 +0000</pubDate>
			<dc:creator>tiagodourado</dc:creator>
			<guid isPermaLink="false">6291@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I'm new to k-wave and I'm having trouble applying the deconvolution with a linear chirp that excites a medium that simulates a mortar immersed in water.&#60;/p&#62;
&#60;p&#62;In my model, I put a source and two receivers, and the response of the spectrum content, before and after the deconvolution, is quite different between them (chirp signal or output against deconvolved signals). Anyone have any suggestions?&#60;/p&#62;
&#60;p&#62;If need, I can post my script.&#60;/p&#62;
&#60;p&#62;I want to take the opportunity to congratulate the software developers and the opportunity of this channel.&#60;/p&#62;
&#60;p&#62;thanks for reading.&#60;/p&#62;
&#60;p&#62;Tiago Dourado
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
