Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Removing Instrument Response from Magnetics Signal
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
t = angle(T2.y.data); %Create a phase vector for the original data
Fs = 40; %Sampling frequency
NFFT = size(y);
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
Pnew=interp1(F1,P,F); %Create the phase delay vector of the same length
Pnew(1) = Pnew(2);
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);
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?
0 · ·