# MODE IDENTIFICATION
mode1_idx = 7 # determined visually
mode2_idx = 58 # determined visually
mode1_freq = freq[mode1_idx]
mode2_freq = freq[mode2_idx]
print("Mode 1 frequency: %.2f GHz"%(mode1_freq/1e9))
print("Mode 2 frequency: %.2f GHz"%(mode2_freq/1e9))
# PLOT THE SPECTRUM
plt.plot(freq/1e9, spectr)
plt.axvline(mode1_freq/1e9, lw=1, ls='--', c='gray')
plt.axvline(mode2_freq/1e9, lw=1, ls='--', c='gray')
plt.xlim(0,fmax/1e9)
plt.ylabel("Spectrum (a.u.)")
plt.xlabel("Frequency (GHz)")
plt.show()
In this example there were only two peaks so it is convenient to plot them manually, howsoever in my case I am
getting multiple peaks, hence it is very time taking to first determine visually each peak and then to calculate fft of each cell
corresponding to each frequency value. Is there any way by which-
1. I can get value of frequency corresponding to each peak?
2. FFT of each cell corresponding to particular value of frequencies obtained above.
I would be very thankful if someone can help me with this.
With regards
Diksha