Somesthesis is the body sense, and it can include pain, warmth, touch, vibration, etc.
Experience affects both sensations and perceptions.
Sensory transduction is the change from one kind of energy to the electrico-chemical impulse in the neurone. The change takes place in receptor cells. The answer is we code anatomically and temporally. Optic nerve stimulation produces impressions of light, in this theory, even if the input was you rubbing your eyes. Psychophysics is the study of the relation between an input and the sensation or perception it produces.