We present a process that allows to learn complex spatiotemporal signals, in a large random neural system with a self-generated
chaotic dynamics. Our system modelizes a generic sensory structure. We study the interplay between a periodic spatio-temporal
stimulus, i.e a sequence of spatial patterns (which are not necessarily orthogonal), and the inner dynamics, while a Hebbian
learning rule slowly modifies the weights. Learning progressively stabilizes the initial chaotic dynamical behavior, and tends
to produce a reliable resonance between the inner dynamics and the outer signal. Later on, when a learned stimulus is presented,
the inner dynamics becomes regular, so that the system is able to simulate and predict in real time the evolution of its input
signal. On the contrary, when an unknown stimulus is presented, the dynamics remains chaotic and non-specific.