关于MATLAB的fft变换
ATP仿真得到的VFTO波形见附件,变换程序如下。目的是求取VFTO波形在50MHz范围内的幅频曲线
怎么感觉结果怪怪的?
clear all;
clc;
%Reading the inout waveform
fid=fopen('wave.dat','r+');
D=fscanf(fid,'%f');
for i=1:numel(D)/2
t(i)=D(2*i-1);
x(i)=D(2*i);
end
fs=500e+6;
p=log2(numel(D)/2);
number=2^p; %65536;
y=fft(x,number);
n=length(y);
m=abs(y)*2/n;
f=(0:n/2-1)*fs/n;
plot(f, m(1:n/2),'k'); hehe,大家都忙,没人答理呢
欢迎讨论 我感觉程序没有错,只是直流分量应该除以n而不是n/2
页:
[1]