24小时热门版块排行榜    

查看: 1912  |  回复: 2

jour橙子

新虫 (初入文坛)

[求助] fft变换后在图中显示峰值和频率

用matlab做fft变换后,如何在图中显示峰值和频率
请教一下怎么标出图上的频率值
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
cenwanglai(金币+5): 很强大~~ 2012-03-10 08:44:54
jour橙子: 金币+3, ★★★很有帮助 2012-03-19 19:51:48
见下面的例子
CODE:
x=linspace(1,10,512);
y=exp(-0.01*x).*cos(2*x)+2*exp(-0.015*x).*sin(10*x);
Y = fft(y,512);
Pyy = abs(Y);  
f = 500*(0:255)/512;
plot(f,Pyy(1:256))
pp=Pyy(1:256);
hold on
b=find(diff(sign(diff(pp)))<0)+1;% 求解极值点序号
plot(f(b), pp(b),'r*')
for i=1:length(b)
text(f(b(i)), pp(b(i)),[num2str(floor(f(b(i)))),'Hz'])
end

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-03-09 09:55:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

如图


The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
3楼2012-03-09 09:57:14
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 jour橙子 的主题更新
信息提示
请填处理意见