- https://www.mathworks.com/help/releases/R2023b/matlab/ref/polyfit.html?searchHighlight=polyfit&s_tid=doc_srchtitle#responsive_offcanvas
- https://www.mathworks.com/help/releases/R2023b/matlab/ref/polyval.html?searchHighlight=polyval&s_tid=doc_srchtitle#responsive_offcanvas
Extracting signal phase using MAximum Entropy Method
11 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
Arnav
2024-7-30
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biotech and Pharmaceutical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!