Issues with an Inverse Fourier Transform
Show older comments
I have an algorithm that I am trying to reverse. The initial algorithm involves a Fast Fourier Transform of a matrix I call d:
for m = 1:f
D(:,m) = fft(d(:,m)/sqrt(J));
end
After stepping through the rest of the initial algorithm and running through the reverse of it, I arrive to the point where I need to Inverse Fast Fourier Transform the D matrix above that is renamed below to D_ROI:
for m = 1:f
% Inverse fft to get to weighted measured data
d_ROI(:,m) = (ifft(D_ROI(:,m)));
end
Essentially, I need d_ROI to equal d to continue on through the reverse of my algorithm to prove that it works. It seems as simple as the ifft and a normalization factor, but for some reason, it's not. I've attached the code with the input .csv file.
Answers (1)
In your forward processing you have applied a scale factor of 1/sqrt(J). In your inversion, you therefore need to apply 1/(1/sqrt(J)).
4 Comments
Sean Raffetto
on 26 Oct 2017
Matt J
on 26 Oct 2017
Well, your actual code from your attachment is as below. I see no resemblance at all between the scaling 1/ TH{m,n}(j,1) in the forward direction and the reverse direction 1/v(j). Also the scaling is j-dependent unlike in your posted question where it is a global constant.
% Instead of ifft to get to h, we want to go from h to get to the
% point-by-point fft.
for m = 1:f
for n = 1:N
TTH_ROI{m,n} = (fft(ttH_2{m,n}));
for j = 1:J
% Gets back to weighted measured data
D_ROI(j,m) = TTH_ROI{m,n}(j,1) / TH{m,n}(j,1);
end
end
end
for m = 1:f
% Inverse fft to get to weighted measured data
d_ROI(:,m) = (ifft(D_ROI(:,m)));
end
% Remove the wighting factor to become a pattern again
for m = 1:f
for j = 1:J
MeasuredH_ROI(j,m) = d_ROI(j,m) / v(j);
end
end
Sean Raffetto
on 26 Oct 2017
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!