MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB信号处理] matlab中FFT分析后的相位问题 (https://www.labfans.com/bbs/showthread.php?t=19017)

lby564644245 2013-09-08 20:22

matlab中FFT分析后的相位问题
 
1 个附件
% 建立最简单的三角函数,进行傅里叶分析
% f=2*sin(2*pi*f1*t+pi/3)-10*cos(2*pi*f1*t+2*pi/3);
t=0:1/8000:1-1/8000; %采样点数8000,采样频率8kHz
N=8000;
f1=50;
f2=100;
k1=2;
k2=10;
f=k1*sin(2*pi*f1*t+pi/6)-k2*cos(2*pi*f2*t+pi/4);%自己构造的简单的三角函数
h_fft=fft(f,N); %对信号进行FFT变换
Pyy=[1:N/2];
for i=1:N/2
Pyy(i)=angle(h_fft(i)); %计算相位
end;
stem(Pyy(1:N/2));
axis([0 700 -4 4])
xlabel('频率/Hz')
ylabel('相位')
title('信号相位谱')
grid on

画出的相位谱为什么不对呢?


所有时间均为北京时间。现在的时间是 14:47

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.