feat: Add logic block log to performSignalProcessing in reflect reconstruction
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "Matrix.h"
|
||||
#include "common/dataBlockCreation/removeDataFromArrays.h"
|
||||
#include "config/config.h"
|
||||
#include "log/log.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
@@ -121,6 +122,7 @@ namespace Recon {
|
||||
const Aurora::Matrix &blockedReceiverPosition,
|
||||
const Aurora::Matrix &blockedGain, const Aurora::Matrix &blockedChannels,
|
||||
MeasurementInfo &info, const PreComputes &preComputes) {
|
||||
RECON_INFO("============================>performSignalProcessing start!");
|
||||
std::vector<Aurora::Matrix> result;
|
||||
auto t = size(blockedAScans);
|
||||
size_t nSamples = (int)t[0];
|
||||
@@ -133,6 +135,8 @@ namespace Recon {
|
||||
}
|
||||
int winLength = 100;
|
||||
auto ascanMapValue = Aurora::zeros(1,blockedAScans.getDimSize(1),1);
|
||||
RECON_INFO("performSignalProcessing step 1 done!");
|
||||
|
||||
// #pragma omp parallel for num_threads(32)
|
||||
#pragma omp parallel for
|
||||
for (size_t i = 0; i < blockedAScans.getDimSize(1); i++)
|
||||
@@ -179,7 +183,10 @@ namespace Recon {
|
||||
}
|
||||
blockedAScans(Aurora::$,i)= _blockedAScans;
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 1 done!");
|
||||
|
||||
auto fx_all = fft(blockedAScans);
|
||||
RECON_INFO("performSignalProcessing fft 1 done!");
|
||||
|
||||
if (reflectParams::useCorrelation && reflectParams::matchedFilterCeAScan)
|
||||
{
|
||||
@@ -218,18 +225,25 @@ namespace Recon {
|
||||
Aurora::free(value2);
|
||||
fx_all(Aurora::$,i) = complex;
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 2 done!");
|
||||
|
||||
blockedAScans = Aurora::real(ifft(fx_all));
|
||||
RECON_INFO("performSignalProcessing ifft 2 done!");
|
||||
|
||||
blockedAScans.setBlockValue(0, 0, winLength-1, 0);
|
||||
blockedAScans.setBlockValue(0, blockedAScans.getDimSize(0)-winLength, blockedAScans.getDimSize(0)-1, 0);
|
||||
blockedAScans = fft(blockedAScans);
|
||||
RECON_INFO("performSignalProcessing fft 2 done!");
|
||||
|
||||
}
|
||||
else{
|
||||
blockedAScans = fx_all;
|
||||
}
|
||||
RECON_INFO("->offsetSignalFourier start!");
|
||||
|
||||
auto exponent = offsetSignalFourier(preComputes, nSamples);
|
||||
// exponent.forceReshape(1, exponent.getDataSize(), 1);
|
||||
RECON_INFO("->offsetSignalFourier finish!");
|
||||
|
||||
// #pragma omp parallel for num_threads(32)
|
||||
#pragma omp parallel for
|
||||
@@ -238,8 +252,11 @@ namespace Recon {
|
||||
Aurora::Matrix _blockedAScans = getPartMatrixColRef(blockedAScans,i);
|
||||
blockedAScans(Aurora::$,i) =_blockedAScans*exponent;
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 3 done!");
|
||||
|
||||
blockedAScans = real(ifft(blockedAScans));
|
||||
RECON_INFO("performSignalProcessing ifft 3 done!");
|
||||
|
||||
if (reflectParams::removeTransmissionSignal == 1) {
|
||||
// #pragma omp parallel for num_threads(32)
|
||||
#pragma omp parallel for
|
||||
@@ -342,9 +359,13 @@ namespace Recon {
|
||||
// blockedAScans(Aurora::$,i) =_blockedAScans;
|
||||
}
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 4 done!");
|
||||
|
||||
}
|
||||
// auto __blockedAScans = fft(blockedAScans(Aurora::$,0).toMatrix());
|
||||
blockedAScans = fft(blockedAScans);
|
||||
RECON_INFO("performSignalProcessing fft 4 done!");
|
||||
|
||||
if(reflectParams::useOptPulse==1){
|
||||
auto n = nSamples;
|
||||
auto nHalf = round((float)n/2);
|
||||
@@ -358,8 +379,11 @@ namespace Recon {
|
||||
_blockedAScans.setBlockComplexValue(0,nHalf,_blockedAScans.getDimSize(0)-1, std::complex<float>{0,0});
|
||||
_blockedAScans.setBlock(0,1,nHalf-1,_blockedAScans.block(0,1,nHalf-1)*2);
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 5 done!");
|
||||
|
||||
blockedAScans = ifft(blockedAScans, n);
|
||||
RECON_INFO("performSignalProcessing ifft 5 done!");
|
||||
|
||||
|
||||
blockedAScans = abs(blockedAScans);
|
||||
|
||||
@@ -407,8 +431,11 @@ namespace Recon {
|
||||
}
|
||||
help_all(Aurora::$,i) = help;
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 6 done!");
|
||||
|
||||
help_all = fft(help_all);
|
||||
RECON_INFO("performSignalProcessing fft 6 done!");
|
||||
|
||||
|
||||
// #pragma omp parallel for num_threads(32)
|
||||
#pragma omp parallel for
|
||||
@@ -418,8 +445,10 @@ namespace Recon {
|
||||
Aurora::Matrix help = getPartMatrixColRef(help_all,i);
|
||||
help_all(Aurora::$,i) = help*(preComputes.sincPeak_ft);
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 7 done!");
|
||||
|
||||
help_all = real(ifft(help_all));
|
||||
RECON_INFO("performSignalProcessing ifft 7 done!");
|
||||
|
||||
// #pragma omp parallel for num_threads(32)
|
||||
#pragma omp parallel for
|
||||
@@ -429,10 +458,13 @@ namespace Recon {
|
||||
Aurora::Matrix help = getPartMatrixColRef(help_all,i);
|
||||
Aurora::compareSet(_blockedAScans,0,help,Aurora::NL);
|
||||
}
|
||||
RECON_INFO("performSignalProcessing loop 8 done!");
|
||||
|
||||
}
|
||||
else{
|
||||
blockedAScans = real(ifft(blockedAScans));
|
||||
RECON_INFO("performSignalProcessing ifft 8.1 done!");
|
||||
|
||||
}
|
||||
result.push_back(blockedAScans);
|
||||
|
||||
@@ -443,6 +475,7 @@ namespace Recon {
|
||||
}
|
||||
|
||||
result.push_back(ascanMapValue);
|
||||
RECON_INFO("============================>performSignalProcessing finish!");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ void producerThread( Parser* aParser, const Aurora::Matrix& aMotorPos,
|
||||
std::string msg;
|
||||
|
||||
}
|
||||
printf(" - optimal pulse");
|
||||
// printf(" - optimal pulse");
|
||||
if(reflectParams::useOptPulse==1 && reflectParams::runReflectionReco)
|
||||
{
|
||||
aPreComputes.sincPeak_ft = determineOptimalPulse(aPreComputes.timeInterval, aExpInfo.expectedAScanLength);
|
||||
@@ -91,8 +91,7 @@ void producerThread( Parser* aParser, const Aurora::Matrix& aMotorPos,
|
||||
auto preprocessData = preprocessAScanBlockForReflection(blockData.ascanBlockPreprocessed, blockData.mpBlock, blockData.slBlock,
|
||||
blockData.snBlock, blockData.rlBlock, blockData.rnBlock, blockData.senderPositionBlock,
|
||||
blockData.receiverPositionBlock, blockData.gainBlock, channelBlock, aExpInfo, aPreComputes);
|
||||
std::cout<<"\rReflect reconstructing...... "<< index<<"/64";
|
||||
std::cout.flush();
|
||||
RECON_INFO("Reflect reconstructing...... {0}",index);
|
||||
index++;
|
||||
// std::unique_lock<std::mutex> lock(PRODUCER_MUTEX);
|
||||
// PRODUCER_BLOCKDATAS.push(blockData);
|
||||
@@ -148,7 +147,6 @@ Aurora::Matrix Recon::startReflectionReconstruction( Parser* aParser, int aSAFT_
|
||||
// }
|
||||
|
||||
// thread.join();
|
||||
std::cout<<"Reflect reconstructing done"<< std::endl;
|
||||
std::cout.flush();
|
||||
RECON_INFO("Reflect reconstructing done");
|
||||
return Matrix();
|
||||
}
|
||||
Reference in New Issue
Block a user