Extracting signal phase using MAximum Entropy Method

10 Ansichten (letzte 30 Tage)
Foad
Foad am 1 Jun. 2024
Beantwortet: Foad am 2 Aug. 2024
Dear community,
I have measured the SFG signal as a function of IR frequency (SFG intensity vs Frequency) and saved it in the file "Rehl.txt". The obtained phase for this signal is saved in another file named "MEM_Phi.txt". I am now using the Maximum Entropy Method (MEM) to extract the phase of the SFG signal.
I have written a code in the file "MEM_Phase.m", but the problem is that the calculated MEM phase is different from the actual phase provided in "MEM_Phi.txt". I would greatly appreciate any help in resolving this issue.
I have also attached a paper that contains the relevant equations. In equation 14 of the paper, P(v) represents the SFG intensity that we have already measured. The unknowns in equation 14 are the values of "beta" and "a_k". By obtaining the values of "a_k", we can calculate the denominator of equation 14, which is a complex value. The MEM phase will then be the phase of these complex values.
Thank you for your assistance.

Antworten (2)

Arnav
Arnav am 30 Jul. 2024
Hi @Foad,
I went through the code and the paper you provided. The code seems to be correct in all respects. After reading the paper, I realised that the generated phase is not expected to be the same as the actual phase. This is due to a phase error.
The paper states:
There is a workaround for this. The paper states that the error term can be approximated by a polynomial as:
To do this, we evaluate the error function for a few anchor points in the middle of the spectrum (for this we need a few actual phase values). Then instead of using the vandermonde matrix, we can fit the data using polyfit and generate error values for all frequencies using polyval.
You can find the implementation of the idea below:
% This part comes after the calculation of MEME_Phase is done
Phi_spectrum = interp1(IR_frequency, known_phase_file(:,2), w2, 'spline');
% 3 Anchor Points
points = [M-25, M, M+25]
% get actual error for these anchor points
Phi_error = Phi_spectrum(points)' - MEME_phase(points);
% fit Phi_error over the entire length of spectrum
B = polyfit(points,Phi_error,length(points));
% Calculate the actual phase
actual_phase = MEME_phase + polyval(B,1:N);
Plotting actual_phase instead of the MEME_phase gives a better predicted result:
You can find the documentation of polyfit and polyval here:

Foad
Foad am 2 Aug. 2024
Thank you so much for your time and help. I realize that my explanation might not have been entirely clear, which could have caused some confusion. The process I'm working on involves determining the actual phase of a measured SFG signal (θ). To do this, the first step is to obtain the phase of the measured signal, referred to as the MEM phase (Ψ). Once this MEM phase is extracted, it needs to be combined with another phase known as the error phase (Φ) to yield the true SFG phase (θ).
The issue I'm facing lies in the first step of this procedure. When I use my MATLAB code to extract the MEM phase (Ψ) from the measured SFG intensity, the results differ from those obtained using a Fortran-based code developed by a physicist (Unfortunately, I only have access to the executable file and not the written code). In the attached image, the red curve represents the MEM phase derived from the Fortran code, while the blue curve shows the results from my MATLAB code. My current challenge is to understand and resolve the discrepancy between these two curves, as they are supposed to match.
(The updated MATLAB code was attached.)
Thanks again for your help.

Kategorien

Mehr zu Biotech and Pharmaceutical finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by