A General Formula For Channel Capacity