Mercurial > hg > smallbox
annotate util/opFFTxd.m @ 203:f3b6ddd2f04f luisf_dev
checks if the variable SMALL_path exists, and exits otherwise.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 20 Mar 2012 15:52:22 +0000 |
parents | 87b76775083b |
children |
rev | line source |
---|---|
idamnjanovic@48 | 1 function op = opFFTxd(n, dim) |
idamnjanovic@48 | 2 % OPFFT One-dimensional fast Fourier transform (FFT). |
idamnjanovic@48 | 3 % |
idamnjanovic@48 | 4 % OPFFT(N) create a one-dimensional normalized Fourier transform |
idamnjanovic@48 | 5 % operator for vectors of length N. |
idamnjanovic@48 | 6 |
idamnjanovic@48 | 7 % Copyright 2008, Ewout van den Berg and Michael P. Friedlander |
idamnjanovic@48 | 8 % http://www.cs.ubc.ca/labs/scl/sparco |
idamnjanovic@48 | 9 % $Id: opFFT.m 1040 2008-06-26 20:29:02Z ewout78 $ |
idamnjanovic@48 | 10 |
idamnjanovic@48 | 11 op = @(x,mode) opFFTxd_intrnl(n,x, dim,mode); |
idamnjanovic@48 | 12 |
idamnjanovic@48 | 13 |
idamnjanovic@48 | 14 function y = opFFTxd_intrnl(n,x,dim,mode) |
idamnjanovic@48 | 15 x=reshape(x, [size(x,1)/n n]); |
idamnjanovic@48 | 16 %checkDimensions(n,n,x,mode); |
idamnjanovic@48 | 17 if mode == 0 |
idamnjanovic@48 | 18 y = {size(x,1),size(x,1),[1,1,1,1],{'FFT'}}; |
idamnjanovic@48 | 19 elseif mode == 1 |
idamnjanovic@48 | 20 y = fft(x, [], dim);% / sqrt(length(x)); |
idamnjanovic@48 | 21 else |
idamnjanovic@48 | 22 y = ifft(x, [], dim);% * sqrt(length(x)); |
idamnjanovic@48 | 23 end |
idamnjanovic@48 | 24 y=reshape(y, [size(y,1)*size(y,2) 1]); |
idamnjanovic@48 | 25 |