ROS New Topic with msgs from existing topic

How to create a new topic that performs some operations (addition of x,y and z data) on the sensor msgs obtained by subscribing to an existing topic. Any reference or tutorial on the same. Thank You