Add a new thread for spectrum calculation.

This thread for solving the time consuming problem. The previous one is a little slow. The system will crash down if the spectrum is not enough fast. Therefore, this new thread is to test if this is possible for handling such situation. Please merge this branch as fast as you can. then I can test it in the real machine.