sun33chao 发表于 2011-6-2 10:18

离散点的傅里叶变换

本帖最后由 sun33chao 于 2011-6-2 10:21 编辑

离散点的FFT变换
离散数据点的fft变换我现在通过计算得到一组数据,想通过程序来实现它的fft变换,可是自己编写的程序不能实现,谁有空帮我修改一下。
Tc=360;
L=500;
T=1/L;
N=360;%720 2^nextpow2(Tc)
q=[ 0, 0.0553, 0.042, 0.0286, 0.0153, 0.00112, -0.0122, -0.0254, -0.0385, -0.0458, -0.0536, -0.0617, -0.0702, -0.079, -0.0881, -0.0973, -0.107, -0.116, -0.123, -0.129, -0.134, -0.138, -0.144, -0.15, -0.156, -0.162, -0.169, -0.176, -0.183, -0.191, -0.198, -0.207, -0.215, -0.225, -0.235, -0.245, -0.256, -0.269, -0.281, -0.292, -0.304, -0.315, -0.326, -0.337, -0.348, -0.358, -0.369, -0.379, -0.389, -0.398, -0.408, -0.417, -0.425, -0.434, -0.442, -0.45, -0.457, -0.464, -0.47, -0.477, -0.482, -0.488, -0.492, -0.497, -0.501, -0.504, -0.507, -0.51, -0.512, -0.513, -0.514, -0.515, -0.515, -0.514, -0.513, -0.512, -0.51, -0.507, -0.504, -0.5, -0.496, -0.491, -0.486, -0.481, -0.474, -0.468, -0.46, -0.453, -0.445, -0.436, -0.427, -0.417, -0.408, -0.397, -0.386, -0.375, -0.364, -0.352, -0.339, -0.327, -0.314, -0.3, -0.287, -0.273, -0.259, -0.244, -0.23, -0.215, -0.2, -0.185, -0.17, -0.154, -0.139, -0.123, -0.107, -0.0915, -0.0757, -0.0599, -0.0441, -0.0284, -0.0127, 0.00283, 0.0183, 0.0337, 0.0488, 0.0639, 0.0787, 0.0933, 0.108, 0.122, 0.136, 0.149, 0.162, 0.175, 0.188, 0.2, 0.212, 0.223, 0.234, 0.244, 0.254, 0.264, 0.273, 0.281, 0.289, 0.296, 0.303, 0.309, 0.315, 0.32, 0.324, 0.328, 0.331, 0.333, 0.335, 0.336, 0.336, 0.336, 0.342, 0.347, 0.35, 0.351, 0.351, 0.35, 0.348, 0.344, 0.339, 0.334, 0.327, 0.319, 0.311, 0.302, 0.282, 0.263, 0.245, 0.219, 0.195, 0.172, 0.151, 0.131, 0.112, 0.0927, 0.0737, 0.0556, 0.0382, 0.0211, 0.00541, -0.00938, -0.0233, -0.0272, -0.0313, -0.0355, -0.0399, -0.0443, -0.0489, -0.0536, -0.0584, -0.0632, -0.0659, -0.0684, -0.0707, -0.0727, -0.0744, -0.0757, -0.0768, -0.0776, -0.0781, -0.0782, -0.078, -0.0775, -0.0766, -0.0754, -0.0739, -0.0719, -0.0696, -0.0669, -0.0639, -0.0604, -0.0565, -0.0523, -0.0475, -0.0424, -0.0368, -0.0307, -0.0242, -0.0172, -0.00971, -0.00172, (-9.27)*10^(-4), (-4.67)*10^(-4), (-3.54)*10^(-4), (-6.05)*10^(-4), -0.00124, -0.00227, -0.00372, -0.0056, -0.00795, -0.0108, -0.0141, -0.0179, -0.0223, -0.0272, -0.0327, -0.0388, -0.0455, -0.0451, -0.0445, -0.0437, -0.0427, -0.0415, -0.0401, -0.0385, -0.0368, -0.0348, -0.0327, -0.0303, -0.0278, -0.025, -0.0221, -0.019, -0.0156, -0.0121, -0.00841, -0.00452, (-4.45)*10^(-4), 0.00381, 0.00824, 0.0128, 0.0176, 0.0226, 0.0277, 0.0329, 0.0383, 0.0438, 0.0495, 0.0553, 0.0613, 0.0673, 0.0735, 0.0797, 0.0861, 0.0925, 0.099, 0.106, 0.112, 0.119, 0.126, 0.132, 0.139, 0.146, 0.153, 0.16, 0.166, 0.173, 0.18, 0.187, 0.193, 0.2, 0.206, 0.212, 0.219, 0.225, 0.231, 0.237, 0.243, 0.248, 0.254, 0.259, 0.264, 0.269, 0.274, 0.282, 0.297, 0.312, 0.325, 0.338, 0.349, 0.36, 0.37, 0.379, 0.387, 0.394, 0.401, 0.407, 0.411, 0.416, 0.419, 0.422, 0.42, 0.41, 0.4, 0.39, 0.381, 0.371, 0.361, 0.352, 0.342, 0.332, 0.322, 0.313, 0.303, 0.293, 0.283, 0.273, 0.263, 0.253, 0.243, 0.233, 0.223, 0.212, 0.202, 0.192, 0.176, 0.16, 0.145, 0.131, 0.117, 0.104, 0.0911, 0.0791, 0.0678]
y=fft(q,N)/Tc;%进行fft变换
mag=abs(y);%求幅值
f=2*pi*(0:(N-1)/2)*(Tc)/N;%横坐标频率的表达式为f=(0:N-1)*fs/N;Tc/2*linspace(0,1,N/2)
% subplot(232);plot(f,y(1:N/2))
plot(f,2*mag(1:N/2));
谢谢了
我现在有1.fig这样的一组数据,想得到2。fig这样的变换数据,请问怎么处理?

zhouyang664 发表于 2011-6-2 21:54

fft理解上挺困难的,学的时候得下功夫,这是学习时候的作用,也是关于画fft的,希望对你有帮助!

ChaChing 发表于 2011-6-3 00:31

...我现在有1.fig这样的一组数据,想得到2。fig这样的变换数据...
看不清楚LZ的意思??:@)

goldsound 发表于 2011-6-3 08:29

回复 2 # zhouyang664 的帖子

好的谢谢

csuxyl 发表于 2013-6-3 10:35

多谢楼上的分享
页: [1]
查看完整版本: 离散点的傅里叶变换