How to do frequency scaling/averaging using matlab?

I have a set of data ( frequency vs Intensity). the frequency spacing is not constant it varies by a little amount . for example 3 consecutive values are 14290.218,14289.593,14288.969. In order to make the spacing same in between I want to round of each frequency (eg, 14290,14289,14288 etc.) and then average the corresponding intensity . So I need to make some kind of counter that will take care of the frequency and also return the averaged intensity.
Please help.
Thanks, Chayan

 采纳的回答

Maybe you want interpolation
f=[14290.218, 14289.593, 14288.969]
intensity=[4 10 20]
fi=[14290,14289,14288]
intensity_new=interp1(f,intensity,fi)

2 个评论

Well, in that case the problem is sometimes if I have two frequency which are same ( 14288.969,14288.278) it will not simply average the corresponding intensities. right?
I worked out something using the interpolation concept, Thanks a lot for your input. I appreciate it.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by