https://hal.archives-ouvertes.fr/hal-02960741
Raw File
Tip revision: a402d485d58ae710ace7c0c1477caf73137c2d28 authored by Software Heritage on 31 December 2012, 00:00:00 UTC
hal: Deposit 1060 in collection hal
Tip revision: a402d48
init_from_raw_data.m
%% Main script to recompute spectra and ground truth ODS from raw data 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                        
% Nearfield ACoustic HOlography with Sparse regularization (NACHOS)
% Version 1.0                                    
%     
% Copyright 2012 Antoine Peillot, Fran蔞is Ollivier, Gilles Chardon, 
%                Laurent Daudet, Nancy Bertin, R幦i Gribonval
% 
% For all details please refer to README.TXT
%
% This software is a free software distributed under the terms of the GNU 
% Public License version 3 (http://www.gnu.org/licenses/gpl.txt). You can 
% redistribute it and/or modify it under the terms of this licence.                                        
%                                                                                                                                                      
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all;

%% Set the main parameters
Fmax = 4000; % Maximum frequency considered in the computation of spectra

PathPrefix = pwd;
addpath('functions');
addpath(genpath('toolbox'));
addpath(genpath('data'));
addpath('temp');
TempPrefix = [PathPrefix,'/temp/'];

%% Load the data acquired by vibrometry
% compute its spectrum
% save the Ground Truth ODS to a temporary directory
disp('Loading Vibrometer data');
[SpectraVibro SPECPVibro] = load_spectra('rectangular/VibroSig.dat',Fmax);
disp('Saving');
save([TempPrefix 'SpectraVibro.mat'],'SpectraVibro','SPECPVibro');

VibroANTP = load('vibroant2000.mat');

%% Load the data acquired with the regular NAH antenna
% compute its spectrum
% save the spectra to a temporary directory
disp('Loading Regular Antenna data');
[SpectraRegAnt SPECPRegAnt] = load_spectra('rectangular/RegAntSig.dat',Fmax);
disp('Saving');
save([TempPrefix 'SpectraRegAnt.mat'],'SpectraRegAnt','SPECPRegAnt');

RegANTP = load('regant1920.mat');
[SpectraRegAnt,RegANTP.XYPos] = reshape_onmeshgrid(SpectraRegAnt,RegANTP.XYPos);

%% Load the data acquired with the 'random' NAH antenna
% compute its spectrum
% save the spectra to a temporary directory

disp('Loading Random Antenna data');
[SpectraRandAnt SPECPRandAnt] = load_spectra_randant('rectangular/RandAntSig.dat',Fmax);
disp('Saving');
save([TempPrefix 'SpectraRandAnt.mat'],'SpectraRandAnt','SPECPRandAnt');

RandANTP = load('randant120.mat');

%%
disp('Selecting frequency of modes to image');
SPECPVibro.RelevantFreqIndices = select_frequencies_adhoc(SpectraVibro,SPECPVibro);
SPECPVibro.SelectedFreqIndices = [165 844 3110 6916];

disp('Extracting ground truth ODS');
[SpectraVibro,VibroANTP.XYPos] = reshape_onmeshgrid(SpectraVibro,VibroANTP.XYPos);
[SelectedGroundTruthODS RelevantGroundTruthODS] = extract_groundtruth_ODS(SpectraVibro,SPECPVibro,VibroANTP);

clear SpectraVibro;
disp('Saving');
save([TempPrefix 'GroundTruthODS.mat'],'VibroANTP','SPECPVibro','SelectedGroundTruthODS','RelevantGroundTruthODS');

%% Load and precompute data for the D-shaped plate
disp('Load and precompute data from the D-shaped plate');
VibroDANTP = load('vibrodant1979.mat');
RegDANTP = load('regant1920.mat');
[SpectraVibroD,SPECPVibroD] = load_spectra_d('data/dshape/VibroSigD.dat',Fmax);
[SpectraRegAntD,SPECPRegAntD] = load_spectra('data/dshape/RegAntSigD.dat',Fmax);

disp('Saving'),
save([TempPrefix 'SpectraRegAntD.mat'],'SpectraRegAntD','SPECPRegAntD');
save([TempPrefix 'SpectraVibroD.mat'],'SpectraVibroD','SPECPVibroD');

[SpectraVibroD,VibroDANTP] = zero_pad(SpectraVibroD,VibroDANTP);
[SpectraVibroD,VibroDANTP.XYPos] = reshape_onmeshgrid(SpectraVibroD,VibroDANTP.XYPos);
[SpectraRegAntD,RegDANTP.XYPos] = reshape_onmeshgrid(SpectraRegAntD,RegDANTP.XYPos);
SPECPVibroD.SelectedFreqIndices = [327 981 2588 5582];
SPECPVibroD.RelevantFreqIndices = [];

%% set a flag to 1
FromScratchFlag=1;

%% some shortcuts
% number of points we wish to reconstruct on the plate
Nx = length(unique(VibroANTP.XYPos(:,1)));
Ny = length(unique(VibroANTP.XYPos(:,2)));
back to top