source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/qtfm/@quaternion/qdft2.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.5 KB
Line 
1function Y = qdft2(X, A, L)
2% QDFT2 Discrete quaternion 2D Fourier transform.
3%
4% This function computes the two-dimensional discrete quaternion Fourier
5% transform of X, which may be a real or complex quaternion matrix.
6% A is the transform axis and it may be a real or complex pure quaternion.
7% It need not be a unit pure quaternion. L may take the values 'L' or 'R'
8% according to whether the hypercomplex exponential is to be multiplied
9% on the left or right of X.
10%
11% This function uses direct evaluation using a matrix product, and it is
12% intended mainly for verifying results against fast transform
13% implementations such as qfft2.m. See also: iqdft2.m.
14
15% Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan.
16% See the file : Copyright.m for further details.
17
18error(nargchk(3, 3, nargin)), error(nargoutchk(0, 1, nargout))
19
20if size(A) ~= [1, 1]
21    error('The transform axis cannot be a matrix or vector.');
22end
23
24if ~isa(A, 'quaternion') | ~ispure(A)
25    error('The transform axis must be a pure quaternion.')
26end
27
28if L ~= 'L' & L ~= 'R'
29    error('L must have the value ''L'' or ''R''.');
30end
31
32A = unit(A); % Ensure that A is a unit (pure) quaternion.
33
34% Compute the transform. This is done by row/column separation, that is we
35% compute the QDFT of the rows, then the QDFT of the columns. This is
36% faster than a direct implementation, and easier, because the direct
37% implementation would require a block matrix for the exponentials, which
38% Matlab cannot support.
39
40Y = qdft(qdft(X, A, L).', A, L).';
Note: See TracBrowser for help on using the repository browser.