==============================================================================
FFTReal
Version 2.00, 2005/10/18
Fourier transformation (FFT, IFFT) library specialised for real data
Portable ISO C++
(c) Laurent de Soras <laurent.de.soras@club-internet.fr>
Object Pascal port (c) Frederic Vanmol <frederic@fruityloops.com>
==============================================================================
1. Legal
--------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Check the file license.txt to get full information about the license.
2. Content
----------
FFTReal is a library to compute Discrete Fourier Transforms (DFT) with the
FFT algorithm (Fast Fourier Transform) on arrays of real numbers. It can
also compute the inverse transform.
You should find in this package a lot of files ; some of them are of interest:
- readme.txt: you are reading it
- FFTReal.h: FFT, length fixed at run-time
- FFTRealFixLen.h: FFT, length fixed at compile-time
- FFTReal.pas: Pascal implementation (working but not up-to-date)
- stopwatch directory
3. Using FFTReal
----------------
Important - if you were using older versions of FFTReal (up to 1.03), some
things have changed. FFTReal is now a template. Therefore use FFTReal<float>
or FFTReal<double> in your code depending on the application datatype. The
flt_t typedef has been removed.
You have two ways to use FFTReal. In the first way, the FFT has its length
fixed at run-time, when the object is instanciated. It means that you have
not to know the length when you write the code. This is the usual way of
proceeding.
3.1 FFTReal - Length fixed at run-time
--------------------------------------
Just instanciate one time a FFTReal object. Specify the data type you want
as template parameter (only floating point: float, double, long double or
custom type). The constructor precompute a lot of things, so it may be a bit
long. The parameter is the number of points used for the next FFTs. It must
be a power of 2:
#include "FFTReal.h"
...
long len = 1024;
...
FFTReal <float> fft_object (len); // 1024-point FFT object constructed.
Then you can use this object to compute as many FFTs and IFFTs as you want.
They will be computed very quickly because a lot of work has been done in the
object construction.
float x [1024];
float f [1024];
...
fft_object.do_fft (f, x); // x (real) --FFT---> f (complex)
...
fft_object.do_ifft (f, x); // f (complex) --IFFT--> x (real)
fft_object.rescale (x); // Post-scaling should be done after FFT+IFFT
...
x [] and f [] are floating point number arrays. x [] is the real number
sequence which we want to compute the FFT. f [] is the result, in the
"frequency" domain. f has the same number of elements as x [], but f []
elements are complex numbers. The routine uses some FFT properties to
optimize memory and to reduce calculations: the transformaton of a real
number sequence is a conjugate complex number sequence: F [k] = F [-k]*.
3.2 FFTRealFixLen - Length fixed at compile-time
------------------------------------------------
This class is significantly faster than the previous one, giving a speed
gain between 50 and 100 %. The template parameter is the base-2 logarithm of
the FFT length. The datatype is float; it can be changed by modifying the
DataType typedef in FFTRealFixLenParam.h. As FFTReal class, it supports
only floating-point types or equivalent.
To instanciate the object, just proceed as below:
#include "FFTRealFixLen.h"
...
FFTRealFixLen <10> fft_object; // 1024-point (2^10) FFT object constructed.
Use is similar as the one of FFTReal.
3.3 Data organisation
---------------------
Mathematically speaking, the formulas below show what does FFTReal:
do_fft() : f(k) = sum (p = 0, N-1, x(p) * exp (+j*2*pi*k*p/N))
do_ifft(): x(k) = sum (p = 0, N-1, f(p) * exp (-j*2*pi*k*p/N))
Where j is the square root of -1. The formulas differ only by the sign of
the exponential. When the sign is positive, the transform is called positive.
Common formulas for Fourier transform are negative for the direct tranform and
positive for the inverse one.
However in these formulas, f is an array of complex numbers and doesn't
correspound exactly to the f[] array taken as function parameter. The
following table shows how the f[] sequence is mapped onto the usable FFT
coefficients (called bins):
FFTReal output | Positive FFT equiv. | Negative FFT equiv.
---------------+-----------------------+-----------------------
f [0] | Real (bin 0) | Real (bin 0)
f [...] | Real (bin ...) | Real (bin ...)
f [length/2] | Real (bin length/2) | Real (bin length/2)
f [length/2+1] | Imag (bin 1) | -Imag (bin 1)
f [...] | Imag (bin ...) | -Imag (bin ...)
f [length-1] | Imag (bin length/2-1) | -Imag (bin length/2-1)
And FFT bins are distributed in f [] as above:
| | Positive FFT | Negative FFT
Bin | Real part | imaginary part | imaginary part
------------+----------------+-----------------+---------------
0 | f [0] | 0 | 0
1 | f [1] | f [length/2+1] | -f [length/2+1]
... | f [...], | f [...] | -f [...]
length/2-1 | f [length/2-1] | f [length-1] | -f [length-1]
length/2 | f [length/2] | 0 | 0
length/2+1 | f [length/2-1] | -f [length-1] | f [length-1]
... | f [...] | -f [...] | f [...]
length-1 | f [1] | -f [length/2+1] | f [length/2+1]
f [] coefficients have the same layout for FFT and IFFT functions. You may
notice that scaling must be done if you want to retrieve x after FFT and IFFT.
Actually, IFFT (FFT (x)) = x * length(x). This is a not a problem because
most of the applications don't care about absolute values. Thus, the operation
requires less calculation. If you want to use the FFT and IFFT to transform a
signal, you have to apply post- (or pre-) processing yourself. Multiplying
or dividing floating point numbers by a power of 2 doesn't generate extra
computation noise.
4. Compilation and testing
--------------------------
Drop the following files into your project or makefile:
Array.*
def.h
DynArray.*
FFTReal*.cpp
FFTReal*.h*
OscSinCos.*
Other files are for testing purpose only, do not include them if you just need
to use the library ; they are not needed to use FFTReal in your own programs.
FFTReal may be compiled in two versions: release and debug. Debug version
has checks that could slow down the code. Define NDEBUG to set the Release
mode. For example, the command line to compile the test bench on GCC would
look like:
Debug mode:
g++ -Wall -o fftreal_debug.exe *.cpp stopwatch/*.cpp
Release mode:
g++ -Wall -o fftreal_release.exe -DNDEBUG -O3 *.cpp stopwatch/*.cpp
It may be tricky to compile the test bench because the speed tests use the
stopwatch sub-library, which is not that cross-platform. If you encounter
any problem that you cannot easily fix while compiling it, edit the file
test_settings.h and un-define the speed test macro. Remove the stopwatch
directory from your source file list, too.
If it's not done by default, you should activate the e
没有合适的资源?快使用搜索试试~ 我知道了~
qt-everywhere-opensource-src-4.7.0.tar.gz
需积分: 10 28 下载量 58 浏览量
2019-06-16
11:24:23
上传
评论
收藏 198.67MB GZ 举报
温馨提示
This is Qt version 4.7.0. Qt is a comprehensive cross-platform C++ application framework. Qt 4 introduces new features and many improvements over the 3.x series. See http://qt.nokia.com/doc/latest/qt4-intro.html for details. The Qt 4.x series is not binary compatible or source compatible with the 3.x series. For more information on porting from Qt 3 to Qt 4, see http://qt.nokia.com/doc/latest/porting4.html.
资源推荐
资源详情
资源评论
收起资源包目录
qt-everywhere-opensource-src-4.7.0.tar.gz (2000个子文件)
sqlite3.c 3.67MB
libmng_pixels.c 800KB
libmng_chunk_io.c 340KB
libmng_display.c 270KB
libmng_chunk_xs.c 252KB
ttinterp.c 251KB
libmng_object_prc.c 226KB
libmng_chunk_descr.c 193KB
malloc.c 190KB
jidctint.c 178KB
jfdctint.c 155KB
pngrtran.c 137KB
harfbuzz-gpos.c 130KB
libmng_chunk_prc.c 121KB
ftobjs.c 117KB
ftraster.c 109KB
libmng_hlapi.c 108KB
tif_fax3sm.c 102KB
CSSValueKeywords.c 102KB
pngrutil.c 95KB
ttcmap.c 95KB
harfbuzz-gsub.c 92KB
libmng_trace.c 82KB
pngwutil.c 82KB
cffgload.c 82KB
libmng_prop_xs.c 81KB
tif_ojpeg.c 73KB
bdflib.c 69KB
t1load.c 69KB
tif_getimage.c 67KB
aflatin2.c 66KB
ttgload.c 64KB
aflatin.c 64KB
deflate.c 63KB
pshalgo.c 60KB
tif_jpeg.c 60KB
shell.c 59KB
libmng_read.c 59KB
tif_dirread.c 58KB
ftgrays.c 56KB
qgrayraster.c 55KB
ttgxvar.c 55KB
gxvcommn.c 54KB
ttsbit.c 53KB
ftstroke.c 50KB
alsasink2.c 49KB
inflate.c 48KB
pngtest.c 48KB
jquant2.c 47KB
jdhuff.c 47KB
jchuff.c 47KB
psobjs.c 47KB
ttload.c 46KB
pngpread.c 46KB
pngwrite.c 45KB
t1decode.c 45KB
tif_fax3.c 44KB
cffload.c 44KB
libmng_jpeg.c 43KB
trees.c 43KB
ftmac.c 42KB
afcjk.c 42KB
jdmarker.c 42KB
pngread.c 41KB
tif_luv.c 41KB
jmemmgr.c 40KB
tif_dir.c 39KB
tif_dirwrite.c 38KB
sfobjs.c 37KB
harfbuzz-arabic.c 37KB
libmng_callback_xs.c 37KB
tif_pixarlog.c 37KB
t42parse.c 34KB
pngset.c 34KB
ttobjs.c 33KB
pcfread.c 33KB
tif_dirinfo.c 33KB
winfnt.c 32KB
ftmac.c 32KB
pshrec.c 31KB
jquant1.c 31KB
afhints.c 31KB
gzio.c 30KB
ptmalloc3.c 30KB
cffobjs.c 30KB
tif_lzw.c 30KB
example.c 30KB
libmng_cms.c 30KB
jcmaster.c 29KB
otvgpos.c 29KB
ftoutln.c 28KB
pvrqwsdrawable.c 28KB
harfbuzz-khmer.c 28KB
jcarith.c 28KB
otvcommn.c 27KB
harfbuzz-open.c 27KB
gxvkern.c 27KB
png.c 26KB
libmng_filter.c 25KB
ftrfork.c 25KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
road2002
- 粉丝: 0
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C# winform置托盘图标并闪烁演示源码.zip
- 打包和分发Rust工具.pdf
- SQL中的CREATE LOGFILE GROUP 语句.pdf
- C语言-leetcode题解之第172题阶乘后的零.zip
- C语言-leetcode题解之第171题Excel列表序号.zip
- C语言-leetcode题解之第169题多数元素.zip
- ocr-图像识别资源ocr-图像识别资源
- 图像识别:基于Resnet50 + VGG16模型融合的人体细胞癌症分类模型实现-图像识别资源
- C语言-leetcode题解之第168题Excel列表名称.zip
- C语言-leetcode题解之第167题两数之和II-输入有序数组.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功