set term png set output "output.png" fs = 16000.0 N_fft = 512.0 set xlabel "Frequency [kHz]" set ylabel "Amplitude [dB]" stats "output.txt" using 1 nooutput set xrange [0:8] set grid plot "output.txt" using ($0 * fs / N_fft / 1000):(20 * log10(($1 > 1e-10 ? $1 : 1e-10) / STATS_max)) \ with lines notitle