
% obecne parametry
soundSpeed = 1540; % [m/s]
samplingFrequency = 100e6; % [Hz]

% nastav vzrkovaci frekvenci
set_sampling(samplingFrequency);

% parametry akustickeho menice; stejne parametry pro prijimac a vysilac
nElements = 128;
kerf = 0.02 / 1000; % [m]
width = 0.2 / 1000; % [m]
height = 5 / 1000; % [m]
focalPoint = [0 0 30] / 1000; % [m]
widthSubdivision = 1;
heightSubdivision = 4;

% vytvor prijimac a vysilac se stejnymi parametry
hndEmitter = xdc_linear_array(nElements, width, height, kerf, widthSubdivision, heightSubdivision, focalPoint);
hndReceiver = xdc_linear_array(nElements, width, height, kerf, widthSubdivision, heightSubdivision, focalPoint);

% parametry impulzove odezvy a budiciho signalu
centralFrequency = 7.5e6; % [Hz]
fractionalBandwidth = 50 / 100; % [%]
excitationSignal = 1;

% tvar impulzove odezvy
tc = gauspuls('cutoff', centralFrequency, fractionalBandwidth, [], -40);
t = -tc : 1/samplingFrequency : tc;
impulseResponse = gauspuls(t, centralFrequency, fractionalBandwidth);

% nastaveni impulzove odezvy piezoelektrickych elementu pro vysilani i
% prijem
xdc_impulse(hndEmitter, impulseResponse);
xdc_impulse(hndReceiver, impulseResponse);

% nastaveni budiciho signalu akusticeho menice
xdc_excitation(hndEmitter, excitationSignal);
