Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
clsm_velocimetry/phaseOnlyFilter.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
22 lines (15 sloc)
919 Bytes
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 PHASE_ONLY_CORRELATION_PLANE = phaseOnlyFilter(COMPLEX_CROSS_CORRELATION_PLANE) | |
% PHASE_ONLY_CORRELATION_PLANE = phaseOnlyFilter(COMPLEX_CROSS_CORRELATION_PLANE) | |
% performs phase-only filtering of a spectral-domain cross correlation signal | |
% Calculate the spectral magnitude of the complex cross correlation | |
% in the frequency domain | |
spectral_magnitude = sqrt(COMPLEX_CROSS_CORRELATION_PLANE .* ... | |
conj(COMPLEX_CROSS_CORRELATION_PLANE)); | |
% If the value of the cross correlation is zero, set the magnitude to 1. | |
% This avoids division by zero when calculating the phase correlation | |
% below (i.e., when dividing the cross correlation by its magnitude). | |
spectral_magnitude(COMPLEX_CROSS_CORRELATION_PLANE == 0 ) = 1; | |
% Divide cross correlation by its nonzero magnitude to extract the phase information | |
PHASE_ONLY_CORRELATION_PLANE = COMPLEX_CROSS_CORRELATION_PLANE ./ ... | |
spectral_magnitude; | |
end | |