Synchronization mechanism and optimization of spreading sequences in chaos-based DS-CDMA systems