ECHO: Frequency-aware Hierarchical Encoding for Variable-length Signals