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

 Accepted Answer

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 Comments

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.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!