From 990e858d02508fa15338017384480111430959e7 Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Mon, 16 Jan 2023 20:07:38 +0100 Subject: [PATCH] checking the instantaneos_frequency --- code/chirp_sim.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/chirp_sim.py b/code/chirp_sim.py index 14d7b0b..e91d05a 100644 --- a/code/chirp_sim.py +++ b/code/chirp_sim.py @@ -24,21 +24,22 @@ plt.close() # trying thunderfish fakefish chirp simulation --------------------------------- -samplerate=44100 +samplerate = 44100 freq, ampl = fakefish.chirps(eodf=500, chirp_contrast=0.2) -data = fakefish.wavefish_eods(fish='Alepto', frequency=freq, fphase0=3) +data = fakefish.wavefish_eods(fish='Alepto', frequency=freq, phase0=3) # filter signal with bandpass_filter -data_filterd = bandpass_filter(data*ampl, samplerate, 495, 505) -data_freq_time, data_freq = instantaneos_frequency(data_filterd, samplerate) +data_filterd = bandpass_filter(data*ampl+1, samplerate, 0.01, 1.99) +data_freq_time, data_freq = instantaneos_frequency(data*ampl, samplerate) fig, ax = plt.subplots(4, 1, figsize=(20 / 2.54, 12 / 2.54), sharex=True) -ax[0].plot(np.arange(len(data))/samplerate, data*ampl) +ax[0].plot(np.arange(len(data))/samplerate, data*ampl+1) ax[1].plot(np.arange(len(data_filterd))/samplerate, data_filterd) ax[2].plot(np.arange(len(freq))/samplerate, freq) ax[3].plot(data_freq_time[1:], data_freq[1:]) plt.show() +embed() \ No newline at end of file