How can I shift phase when the phase correction is frequency dependent?

3 views (last 30 days)
So I am trying to remove instrument response (phase lag) from some magnetics data. The code I am trying to use is below. I can't figure how to reconstruct the file together properly. The approach I am trying now is to subtract the phase lag and reconstruct the signal. I realize that there is maybe another function I could use her. I've had phase rotation suggested, but my phase lag is frequency dependent, so I really need to be able to convolve the vectors somehow... Thank you for your help!
load('coil') % Load coil response data
time = 1/40:1/40:288000/40; %Create time vector for later plotting
%Removing Coil Response
T2=load(mag); %Load data
y=abs(real(T2.y.data));
t = angle(T2.y.data); %Create a phase vector for the original data
Fs = 40; %Sampling frequency
NFFT = size(y);
NFFT=NFFT(1);
j = [y,t]; %Create a matrix of amplitude and phase
Y = fft2(j); %2D transform
F = ((0:1./NFFT:1-1./NFFT)*Fs);
F1=coil(:,1); %Load coil phase delay
P=coil(:,3);
Pnew=interp1(F1,P,F); %Create the phase delay vector of the same length
Pnew(1) = Pnew(2);
Pnew=Pnew';
t_fin = t-Pnew %Subtract the pahse delay from the original phase vector
%Mag_Final = ifft(abs(Y));
%Phase_Final = ifft(phaseF);
j_fin = [y,t_fin]; %Create matrix of amplitude versus correct phase
Final = ifft(j_fin); %Invert the transform
y = struct('data',Final);
save('y')
Both t and y are magnitude and phase data in the time domain. coil(:,1) and could(:,3) are the frequency and phase vectors of the instument response. So the phase vector Pnew is in the frequency domain. IS there another way to correct the phase? Of not, how to I turn the corrected phase vector back into a time domain function?

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!