t = 0:.001:.25;%qu
x = sin(2*pi*50*t) + sin(2*pi*120*t);%取对应函数值
Y = fft(x,251);
>> Pyy = Y.*conj(Y)/251;
f = 1000/251*(0:127);
plot(f,Pyy(1:128))
title('Power spectral density')
xlabel('Frequency (Hz)')
matlab学习之动态仿真和静态仿真
最新推荐文章于 2022-09-15 09:07:25 发布