<?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: frequency shift @ second transducer</title>
		<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 03:45:26 +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/frequency-shift-second-transducer" rel="self" type="application/rss+xml" />

		<item>
			<title>Vali on "frequency shift @ second transducer"</title>
			<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer#post-8062</link>
			<pubDate>Thu, 11 Feb 2021 09:34:16 +0000</pubDate>
			<dc:creator>Vali</dc:creator>
			<guid isPermaLink="false">8062@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks so much for your time!&#60;/p&#62;
&#60;p&#62;You have totally right, I had forgotten to cut off the input-signals.&#60;br /&#62;
In the previous example the frequency spectrums of both sides are equal now&#60;br /&#62;
and centered around the main (center) frequency.&#60;br /&#62;
But if I increase the total number of elements for Tx and Rx (e.g. 128) both spectrums&#60;br /&#62;
are getting a downshift of approx. 1 MHz in center (from 5.2 to 4.2 MHz).&#60;/p&#62;
&#60;p&#62;Does this phenomen occur in case of frequency dependent attenuation with the depth?&#60;br /&#62;
A correct TGC should compensate the frequency shift or?&#60;br /&#62;
(I have tried it with the TGC settings from the B-mode example, but there is no much difference in-between.)&#60;/p&#62;
&#60;p&#62;&#38;gt;Sensor 2 has a lower amplitude because of the directional response of the finite sized sensor which you're averaging over.&#60;/p&#62;
&#60;p&#62;--&#38;gt; The sensor elements do have the same size in horizontal and vertical direction. By default the sensor elements have a&#60;br /&#62;
omnidirectional sensitivity. I don't understand the difference between the amplitudes. I have also tried to align the&#60;br /&#62;
sensitivity direction.&#60;/p&#62;
&#60;p&#62;Would you be so kind to explain that more in detail?&#60;/p&#62;
&#60;p&#62;Best,&#60;br /&#62;
Valentin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "frequency shift @ second transducer"</title>
			<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer#post-8049</link>
			<pubDate>Sat, 06 Feb 2021 14:46:59 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8049@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;You should trim the transmitted signal from the sensor data so it just contains the received signals. For example, set:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% remove the transmitted signal
sensor_data_trim = sensor_data1(:, 400:end);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then if you plot the two spectra, they cover essentially the same bandwidth. For example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% amplitude spectrum of average signal data
testChannel1 = mean(sensor_data_trim(1:16,:));
testChannel2 = mean(sensor_data_trim(17:32,:));
[f, as1] = spect(testChannel1, 1/kgrid.dt);
[~, as2] = spect(testChannel2, 1/kgrid.dt);

% plot
figure;
plot(f * 1e-6, as1);
hold on;
plot(f * 1e-6, as2);
legend(&#38;#39;Sensor 1&#38;#39;, &#38;#39;Sensor 2&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Sensor 2 has a lower amplitude because of the directional response of the finite sized sensor which you're averaging over.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Vali on "frequency shift @ second transducer"</title>
			<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer#post-8039</link>
			<pubDate>Wed, 03 Feb 2021 10:29:08 +0000</pubDate>
			<dc:creator>Vali</dc:creator>
			<guid isPermaLink="false">8039@http://www.k-wave.org/forum/</guid>
			<description>&#60;pre&#62;&#60;code&#62;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%frequency-shift
%
%description:
%Transmitting a plane wave from the horizontal elements and receive it
%with the vertical elements (RX2). Where does this channel dependent shift
%come from? (In compare with the spectrum of the horizontal channels,
%where no shift occurs.)
%note: With an increasing number of channels e.g. 192 the frequency-shift
%will also increase.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all;
close all;

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ground-settings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GPU = false;                                            %if GPU is available

meanSpeedOfSound = 1540;                                %[m/s]
transducerFreq = 5.2083;                                %[MHz]
wavelength = meanSpeedOfSound/(transducerFreq*1e6);     %[m]

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define kgrid
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PML_size = 20;
PMLInside = &#38;#39;false&#38;#39;;                                    %PML is set to &#38;#39;outside the grid&#38;#39;

dxy = (wavelength)/4;                                   

Ny = 243 - 2 * PML_size;                                %checkFactors() ... for computational-time
Nx = 243 - 2 * PML_size;           

Nx = 243 - 2 * PML_size;
Ny = 243 - 2 * PML_size;

kgrid = kWaveGrid(Nx, dxy, Ny, dxy);                    %make grid of given size

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define medium with a scatter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c_tissue = 1540;                                        %[m/s]
density_tissue = 1000;                                  %[kg/m^3]
medium.sound_speed_ref = 1540;
medium.alpha_mode = &#38;#39;no_dispersion&#38;#39;;

medium.sound_speed = c_tissue * ones(Nx, Ny);
medium.alpha_coeff = 0.54 * ones(Nx, Ny);               %[dB/(MHz^y cm)] ... soft tissue
medium.alpha_power = 1.5;                               %= y

medium.density = density_tissue * ones(Nx, Ny);         %[kg/m^3]

inclusion.dimension = [Nx/2 Ny/2 10];
disc_c1 = round([inclusion.dimension(1,1) inclusion.dimension(1,2) inclusion.dimension(1,3)]);
disc1 = logical(makeDisc(Nx, Ny, disc_c1(1), disc_c1(2), disc_c1(3)));
numbOfPix1 = length(medium.sound_speed(disc1));
lowerLimDensity = density_tissue / 1.25;
upperLimDensity = density_tissue * 1.25;      

randDensity = zeros(numbOfPix1,1);
randDensity = (upperLimDensity - lowerLimDensity).*rand(numbOfPix1,1) + lowerLimDensity;
medium.density(disc1) = randDensity;

lowerLimSos = c_tissue / 1.25;
upperLimSos = c_tissue * 1.25;             

randSos = zeros(numbOfPix1,1);
randSos = (upperLimSos - lowerLimSos).*rand(numbOfPix1,1) + lowerLimSos;
medium.sound_speed(disc1) = randSos;

figure(101);
subplot(1,4,1);
imagesc(medium.density);
title(&#38;#39;medium-density&#38;#39;);
subplot(1,4,2);
imagesc(medium.sound_speed);
title(&#38;#39;medium-SoS&#38;#39;);

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define input-signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
height = dxy*Nx;
max_time = 2*height/max(medium.sound_speed(:));
kgrid.t_array = makeTime(kgrid, medium.sound_speed, 0.3, max_time);
sample_freq = 1/kgrid.dt;
signal_freq = transducerFreq*1e6;
num_cycles = 3;
toneBurst_envelope = &#38;#39;Gaussian&#38;#39;;
bandwidth = 80;

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define source (16 elements) and sensor (16 elements each):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
halfDis = round(Ny/2)-8;
source.p_mask = zeros(Nx, Ny);
source.p_mask(20,halfDis:halfDis+15) = 1;
sensor.mask = zeros(Nx, Ny);
%1st RX
sensor.mask(20,halfDis:halfDis+15) = 1;
%1nd RX
sensor.mask(30:45,halfDis+30) = 1;

subplot(1,4,3);
imagesc(source.p_mask);
title(&#38;#39;source-mask&#38;#39;);
subplot(1,4,4);
imagesc(sensor.mask);
title(&#38;#39;sensor-mask&#38;#39;);
truesize;

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%tone-burst-offset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
phi = 0;
toneBurst_offset = zeros(nnz(source.p_mask(:)),1);      %time-delay for elements
toneBurst_offset = sind(phi)*[0:numel(toneBurst_offset)-1]&#38;#39;*dxy/meanSpeedOfSound/kgrid.dt;
input_signal = toneBurst(sample_freq, signal_freq, num_cycles,&#38;#39;SignalOffset&#38;#39;, toneBurst_offset, &#38;#39;Envelope&#38;#39;, toneBurst_envelope);
source.p = input_signal;

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%run simulation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
input_args = {&#38;#39;PMLInside&#38;#39;, false, &#38;#39;PlotPML&#38;#39;, false, &#38;#39;DisplayMask&#38;#39;, source.p_mask, &#38;#39;PlotScale&#38;#39;, [-0.25, 0.25]};
if GPU, input_args = {input_args{:},&#38;#39;DataCast&#38;#39;,&#38;#39;gpuArray-single&#38;#39;};
end
sensor_data1 = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});
if GPU, sensor_data1 = gather(sensor_data1);
end

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%channel selection, frequency-shift at RX2 (vertical elements)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ch1_RX1 = sensor_data1(1,:);
bandwidth = 80;
filteredSigRX1 = gaussianFilter(ch1_RX1, sample_freq, signal_freq, bandwidth, true);
title(&#38;#39;channel 1, RX1-horizontal&#38;#39;);

ch1_RX2 = sensor_data1(32,:);
bandwidth = 80;
filteredSigRX2 = gaussianFilter(ch1_RX2, sample_freq, signal_freq, bandwidth, true);
title(&#38;#39;channel 1, RX2-vertical&#38;#39;);

ch8_RX2 = sensor_data1(28,:);
bandwidth = 80;
filteredSigRX2 = gaussianFilter(ch8_RX2, sample_freq, signal_freq, bandwidth, true);
title(&#38;#39;channel 8, RX2-vertical&#38;#39;);

ch12_RX2 = sensor_data1(24,:);
bandwidth = 80;
filteredSigRX2 = gaussianFilter(ch12_RX2, sample_freq, signal_freq, bandwidth, true);
title(&#38;#39;channel 12, RX2-vertical&#38;#39;);

ch16_RX2 = sensor_data1(17,:);
bandwidth = 80;
filteredSigRX2 = gaussianFilter(ch16_RX2, sample_freq, signal_freq, bandwidth, true);
title(&#38;#39;channel 16, RX2-vertical&#38;#39;);

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%FFT-spectrum, mean value of RX1/RX2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
testChannel = mean(sensor_data1(1:16,:));
nfft = length(testChannel);
ff = fft(testChannel,nfft);
fff = ff(1:nfft/2);                      

fs = 1/kgrid.dt;
fff=fff/max(fff);
fn = fs/2;
df=fs/nfft;
xfft = 0:df:fn-1;
figure(1001);
subplot(1,2,1);
plot(xfft,abs(fff));
xlabel(&#38;#39;frequency/[Hz]&#38;#39;);
title(&#38;#39;FFT mean value of RX1, normalized to 1&#38;#39;);

testChannel = mean(sensor_data1(17:32,:));
nfft = length(testChannel);
ff = fft(testChannel,nfft);
fff = ff(1:nfft/2);
fs = 1/kgrid.dt;
fff=fff/max(fff);
fn = fs/2;
df=fs/nfft;
xfft = 0:df:fn-1;                       

subplot(1,2,2);
plot(xfft,abs(fff));
xlabel(&#38;#39;frequency/[Hz]&#38;#39;);
title(&#38;#39;FFT mean value of RX2, normalized to 1&#38;#39;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "frequency shift @ second transducer"</title>
			<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer#post-8010</link>
			<pubDate>Tue, 19 Jan 2021 20:05:49 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8010@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;HI Valentin,&#60;/p&#62;
&#60;p&#62;Sounds puzzling. Can you post your code?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Vali on "frequency shift @ second transducer"</title>
			<link>http://www.k-wave.org/forum/topic/frequency-shift-second-transducer#post-7982</link>
			<pubDate>Mon, 14 Dec 2020 10:06:35 +0000</pubDate>
			<dc:creator>Vali</dc:creator>
			<guid isPermaLink="false">7982@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I've defined two linear transducers (2D) for plane-wave propagation.&#60;/p&#62;
&#60;p&#62;The first one is defined in the horizontal and the second one in vertical direction.&#60;/p&#62;
&#60;p&#62;If I transmit a plane-wave with the horizontal transducer and receive the signals with both, then I have a large frequency-shift in the spectrum.&#60;/p&#62;
&#60;p&#62;Input-Signal: Gaussian-envelope, 3 cycles and centered at 5.2MHz&#60;br /&#62;
(max supported frequency of the grid ~8.3MHz)&#60;/p&#62;
&#60;p&#62;Spectrum of horizontal transducer: Gaussian-curve centered at ~5.2MHz&#60;br /&#62;
Spectrum of vertical transducer: Gausian-curve shifted to 1.5 - 2.5MHz (channel dependent)&#60;/p&#62;
&#60;p&#62;Where does this large shift come from?&#60;/p&#62;
&#60;p&#62;Any suggestion?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Valentin
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
