Removing Instrument Response from Magnetics Signal - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Removing Instrument Response from Magnetics Signal

IKeneallyIKeneally Posts: 1Member
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(; %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?
Sign In or Register to comment.