指数衰减函数的fft
我写了一个程序,并将fft后的结果调整了一下,使他表示的是原始信号的幅值。这个程序有问题吗?
<p>clear
N=2048;
fs=2000;
T=1/fs;
n=0:N-1;
f=fs/N*(0:N/2);
x=1000000*exp(-200*t);
X=fft(x);
XX(1)=abs(X(1))/N; XX(2:N/2+1)=2*abs(X(2:N/2+1))/N;
plot(f,XX);
</p> 中间少了一个语句,查到5和6行中间
t=n*T;
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAi8AAAGrCAIAAACHf+BAAAAgAElEQVR4Ae3de5AU1d3/8dneYQFJggsSIygPCwR8jAkgLhV+asDHVBCNFlZptNSKokTyS2n+kMJLCcUlWlLG0qAWkRiRRGORlKkYUxTwM0GJIjcVNUbA7CKPFmJK47IxynV3f5/ZhmacObMz07fTM/OeEOw5c279OsN+93Sf7q7r7OxMpVJz586dPXu2NnghgAACCCAQv4CjWNSVSmUiEi8EEEAAAQQsCaQ7UimnOyA9/fTTlvpAswgggAACtS6QPpRK9UqlFJOuueaaWsdg/xFAAAEELAmkD6dS9d3RqL293VIfaBYBBBBAoNYFnP1dqY7uP7Uuwf4jgAACCNgTcA4cqOvoSHVoisQLAQQQQAABSwKKRqmOzpQCEi8EEEAAAQRsCTidh1NdHakurfLmhQACCCCAgCUBp6v7UiOCkSV/mkUAAQQQyAg4dU5Kf5w6OBBAAAEEELAm4PRqSDmKRlrlzQsBBBBAAAFLAk7vPqn6+lQ6bal9mkUAAQQQQCCVSvduSNV3peo5Use3AQEEEEDAnoDTu/teDEyN7A0BLSOAAAIIpBzdpE53TdUfXggggAACCNgSSCsa6Sgd0cjWANAuAggggIAE0m4c4rQR3wYEEEAAAYsCXGhkEZ+mEUAAAQSOCHCIjq8CAggggIB9AYd7AtkfBHqAAAII1LyAo5t3KyARk2r+mwAAAgggYFPA0YONdN9UopHNQaBtBBBAoOYFMnMjRSMeb1Tz3wQAEEAAAZsCzn6ikU1/2kYAAQQQyAg4B/TgV+ZGfBkQQAABBKwKOAf3pz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KIoAAgggEJIA0SgkSKpBAAEEEAggQDQKgEdRBBBAAIGQBIhGIUFSDQIIIIBAAAGiUQA8iiKAAAIIhCRANAoJkmoQQAABBAIIEI0C4FEUAQQQQCAkAaJRSJBUgwACCCAQQIBoFACPoggggAACIQkQjUKCpBoEEEAAgQACRKMAeBRFAAEEEAhJgGgUEiTVIIAAAggEECAaBcCjKAIIIIBASAJEo5AgqQYBBBBAIIAA0SgAHkURQAABBEISqOvq6lJVzzzzzObNm0Oqk2oQQAABBGwKZH6sf/5V9/m3CXx3JBqpZ25YCrGLASsMWLyUHYmhiVK6ESRPzqN7c96q5vyUIM1RNiEC2V/d7G11L+dtkA4Hqcp3Wd8Fs/fU+9rnbyhbfqKXkl1JRW+HG42yB8Xb9jYElb3tuuWnFPU8Fo2KZjU22UOpEntTKFuhdGOLZWXOqSFIWdekxK+yj4ZyingNFd3Iz5Cz116GnHTeJk0g5zvgdc9NL/S3l83b6LkeL1vORn6p/JScIu5b39lKLGhsNCdRX3L3e+5ueH8rm7udveFuuzW4pdztSvxbociNRl5M0sTI/VPu7rjD4Q1K9lttey9Vq23vb68VN9F72/PG/wfa53puRNLOZgAAAABJRU5ErkJggg==
这是图像,0频率点的幅值怎么比后面的小了。
没什么问题吧
Triste 发表于 2017-3-16 08:12
没什么问题吧
最高点不应该在0频率地方吗?我的这个不是啊 本帖最后由 hcharlie 于 2017-3-19 22:10 编辑
你错了!
我说的不是哪一条指令错了,而是概念错了。
你心里想的是做指数衰减函数的傅立叶变换,而实际做的是其有限长一段数据的FFT,由此后面的一切都错了。
指数衰减函数是无穷长的衰减到零的函数,但是你取其一段有限长的数据做FFT(或DFT),实际含义是做了以此段数据无限重复的周期函数的傅立叶分析,因此得到的零频,基频,2,3,4。。。阶频率,也是这个周期函数的概念,你的指数衰减函数不是一个振动信号,不存在所谓的零频,2,3,4阶的频率只有振动问题才有的概念,由于基本出发点有问题,所以结论都错了。
结论:你的指数衰减函数不能做FFT。
close all; %先关闭所有图片
Adc=2; %直流分量幅度
A1=3; %频率F1信号的幅度
A2=1.5; %频率F2信号的幅度
F1=50; %信号1频率(Hz)
F2=75; %信号2频率(Hz)
Fs=256; %采样频率(Hz)
P1=-30; %信号1相位(度)
P2=90; %信号相位(度)
N=256; %采样点数
t=; %采样时刻
%信号
S=Adc+A1*cos(2*pi*F1*t+pi*P1/180)+A2*cos(2*pi*F2*t+pi*P2/180);
%显示原始信号
plot(S);
title('原始信号');
figure;
Y = fft(S,N); %做FFT变换
Ayy = (abs(Y)); %取模
plot(Ayy(1:N)); %显示原始的FFT模值结果
title('FFT 模值');
figure;
Ayy=Ayy/(N/2); %换算成实际的幅度
Ayy(1)=Ayy(1)/2;
F=(-1)*Fs/N; %换算成实际的频率值
plot(F(1:N/2),Ayy(1:N/2)); %显示换算后的FFT模值结果
title('幅度-频率曲线图');
figure;
Pyy=;
for i="1:N/2"
Pyy(i)=phase(Y(i)); %计算相位
Pyy(i)=Pyy(i)*180/pi; %换算为角度
end;
plot(F(1:N/2),Pyy(1:N/2)); %显示相位图
title('相位-频率曲线图');
hcharlie 发表于 2017-3-19 22:02
你错了!
我说的不是哪一条指令错了,而是概念错了。
你心里想的是做指数衰减函数的傅立叶变换,而实际做 ...
我取的那段已经衰减到零了也不能做吗? 本帖最后由 hcharlie 于 2017-3-22 18:54 编辑
evilestspirit 发表于 2017-3-22 16:24
我取的那段已经衰减到零了也不能做吗?
你采集频率2000,采集2048点,大概1秒,你做FFT,结果是以你的2048点无限重复的周期函数的结果,周期函数的周期大概1 秒,最低频率大概是1 Hz,看起来象1 Hz的振动,而实际你的函数是单调衰减的,根本不存在接近1 Hz的振动,也不存在接着出来的2,3,4。。。Hz 的振动,这些振幅都是周期函数的频谱,不是你的单调函数的振幅,你的单调函数没有什么振幅!
就事论事。你说这种情况下零频应该是大还是小呢?我做了几个算例,随着衰减系数的大小的不同,零频相对一阶数量是可大可小的。
谢谢你的回答!我的采集频率和采集点数应该取多少?
页:
[1]