Created
February 11, 2015 11:06
-
-
Save moon6pence/3e60772943f206842d31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [aline1] = getPhaseComplexDFT(nScans, nAlines, fringe, new_index, dispersion) | |
% window function | |
window = hann(length(new_index)); | |
% generate bg by averaging fringes | |
bgm_1 = mean(fringe(:, 1:4:nAlines), 2); | |
bgm_2 = mean(fringe(:, 2:4:nAlines), 2); | |
bgm_3 = mean(fringe(:, 3:4:nAlines), 2); | |
bgm_4 = mean(fringe(:, 4:4:nAlines), 2); | |
bg = repmat([bgm_1 bgm_2 bgm_3 bgm_4], 1, nAlines/4); | |
% background subtraction | |
data_signal = fringe - bg; | |
% FFT real data | |
dft_signal = fft(data_signal); | |
% copy to extended vector, zero padding | |
% length(new_index) = nScans/2 (oph. system) or nScans/4 (doppler system) | |
dft_signal = [dft_signal(1:length(new_index), :); zeros(length(new_index), nAlines)]; | |
% circular shift -1/4 to remove frequency shift effect | |
dft_signal = circshift(dft_signal, -size(dft_signal, 1)/4); | |
% IFFT to get complex fringes | |
scan_signal_zoom1 = ifft(dft_signal); | |
% calibration | |
dft_complex1 = interp1(scan_signal_zoom1, new_index); | |
% numerical dispersion compensation & apply window function | |
dft_complex1 = dft_complex1 .* repmat(dispersion .* window, 1, nAlines); | |
% FFT for imaging | |
dft_complex_zoom1 = fft(dft_complex1); | |
% circular shift -1/2 to remove frequency shift effect | |
aline1 = circshift(dft_complex_zoom1, -size(dft_complex_zoom1, 1)/2); | |
% flip upside down | |
aline1 = flipud(aline1); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment