Mercurial > hg > smallbox
comparison util/opFFTxd.m @ 48:87b76775083b
(none)
author | idamnjanovic |
---|---|
date | Mon, 14 Mar 2011 15:43:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
47:2953097411d4 | 48:87b76775083b |
---|---|
1 function op = opFFTxd(n, dim) | |
2 % OPFFT One-dimensional fast Fourier transform (FFT). | |
3 % | |
4 % OPFFT(N) create a one-dimensional normalized Fourier transform | |
5 % operator for vectors of length N. | |
6 | |
7 % Copyright 2008, Ewout van den Berg and Michael P. Friedlander | |
8 % http://www.cs.ubc.ca/labs/scl/sparco | |
9 % $Id: opFFT.m 1040 2008-06-26 20:29:02Z ewout78 $ | |
10 | |
11 op = @(x,mode) opFFTxd_intrnl(n,x, dim,mode); | |
12 | |
13 | |
14 function y = opFFTxd_intrnl(n,x,dim,mode) | |
15 x=reshape(x, [size(x,1)/n n]); | |
16 %checkDimensions(n,n,x,mode); | |
17 if mode == 0 | |
18 y = {size(x,1),size(x,1),[1,1,1,1],{'FFT'}}; | |
19 elseif mode == 1 | |
20 y = fft(x, [], dim);% / sqrt(length(x)); | |
21 else | |
22 y = ifft(x, [], dim);% * sqrt(length(x)); | |
23 end | |
24 y=reshape(y, [size(y,1)*size(y,2) 1]); | |
25 |