Functional spectrogram in main.cpp