% TGC verification on Fibx
% E401T031_1
clc
clear all
%%
NAME = 'GF80226_20161214_111312.fibx'
%% Variables
Ve = 10.05e-3; % Volt, en charge sur oscilo (faire moyenne 1024)
TGC_Voie0 = 4.03; %uV/LSB, TGC � lire dans la m�moire de la platine
%%
Rapport = 10.0/Ve; % rapport entre la tension GBF (10V) et celle mesur�e.
%% Flag mex
OUVERTURE = 0;
CHARGEMENT = 1;
FERMETURE = 2;
%% Chargement FibX
LoadFibX2(OUVERTURE,NAME,'D:\TMP\'); % verifier que le chemin d'extraction existe
DataAll = LoadFibX2(CHARGEMENT,NAME);
DataMes = LoadFibX2(CHARGEMENT,NAME,0);
DataMesChosen = DataMes.Exam.Measurements.Measure;
DataRF = double(DataMesChosen.RawData.RFElastoMatrix);
DataRF_LTT = double(DataMesChosen.RawData.RFOFTMatrix);
DataRF_DPC = double(DataMesChosen.RawData.RFDPCMatrix);
%% Calculs
switch DataMesChosen.StiffnessCAPParametersInfo.FrequencyUltrasound
case 3.5e6
opt.Fmin = 2.5; %2.5;4.0; %
opt.Fmax = 4.5; %4.5;6.0; %
case 2.5e6
opt.Fmin = 1.5; %2.5;4.0; %
opt.Fmax = 3.5; %4.5;6.0; %
case 5.0e6
opt.Fmin = 4.0; %2.5;4.0; %
opt.Fmax = 6.0; %4.5;6.0; %
end
opt.Fe = DataMesChosen.StiffnessCAPParametersInfo.FrequencySampling/1e6;
opt.Ordre = 6;
opt.Type = 0; % 0 BandPass, 1 LoPass , 2 HiPass, 3 BandStop
[DataRF] = Test_filtrage(0,(DataRF),opt);
[DataRF_LTT] = Test_filtrage(0,(DataRF_LTT),opt);
[DataRF_DPC] = Test_filtrage(0,(DataRF_DPC),opt);
subplot(311)
plot(DataRF(:,1)); xlim([1000 2000])
subplot(312)
plot(DataRF_LTT(:,1)); xlim([1000 2000])
subplot(313)
plot(DataRF_DPC(:,1)); xlim([1000 2000])
clear LSB_1 LSB_2 LSB_3
Size_Fen = 100;
for i=1:floor((size(DataRF,1)-400)/Size_Fen)
for k=1:size(DataRF,2)
LSB_1(i,k) = max(DataRF(i*Size_Fen:i*Size_Fen+Size_Fen,k))-min(DataRF(i*Size_Fen:i*Size_Fen+Size_Fen,k));
end
for k=1:size(DataRF_LTT,2)
LSB_2(i,k) = max(DataRF_LTT(i*Size_Fen:i*Size_Fen+Size_Fen,k))-min(DataRF_LTT(i*Size_Fen:i*Size_Fen+Size_Fen,k));
end
for k=1:size(DataRF_DPC,2)
LSB_3(i,k) = max(DataRF_DPC(i*Size_Fen:i*Size_Fen+Size_Fen,k))-min(DataRF_DPC(i*Size_Fen:i*Size_Fen+Size_Fen,k));
end
end
DataMes.Exam.AcquisitionPlatform.ChannelNumber
Ve2 = 500e-3/Rapport;
% TGC_Voie0 = 1/DataMes.Exam.AcquisitionPlatform.USReceptionGain*1e6; %4.0;
TGC_1 = Ve2/mean(reshape(LSB_1,1,[]))*1e6;
TGC_2 = Ve2/mean(reshape(LSB_2,1,[]))*1e6;
TGC_3 = Ve2/mean(reshape(LSB_3,1,[]))*1e6;
fprintf('TGC RF elasto %2.3fuV/LSB (Err=%2.1f%%)\n',TGC_1,(TGC_1-TGC_Voie0)/TGC_Voie0*100)
fprintf('TGC RF LTT %2.3fuV/LSB (Err=%2.1f%%)\n',TGC_2,(TGC_2-TGC_Voie0)/TGC_Voie0*100)
fprintf('TGC RF DPC %2.3fuV/LSB (Err=%2.1f%%)\n',TGC_3,(TGC_3-TGC_Voie0)/TGC_Voie0*100)
%%
LoadFibX2(FERMETURE,NAME);