Frequency analysis script