set_exec_pars(save=False)
set_preference(Preference.PLOT_DISABLED, True)

plots = None
samples = 20; sampling_freq = 10
while(True):
    signal = tscan(sin, samples, 1/sampling_freq).getReadable(0)
    plots = plot_spectrum(signal, sampling_freq, plots)
    time.sleep(0.1)
    
