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

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
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 comentarios

Chayan Dutta
Chayan Dutta el 18 de Oct. de 2013
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?
Chayan Dutta
Chayan Dutta el 20 de Oct. de 2013
I worked out something using the interpolation concept, Thanks a lot for your input. I appreciate it.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Oct. de 2013

Comentada:

el 20 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by