matlab fft變換 分析頻譜

用快速付裏葉變化換分析 f1=50Hz和 f2=120Hz混合信號的頻譜。


clear;

t = 0:0.001:0.6;

x = sin(2*pi*50*t)+sin(2*pi*120*t);

y = x + randn(size(t));

subplot(211);

plot(y(1:50));

Y=fft(y,512);

f = 1000*(0:256)/512;

subplot(212);

plot(f,Y(1:257));

222310515.jpg

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章