np.argmax function returns the highest frequency value and I want to take that value out and then see what the second highest value is.
import wave
import struct
import matplotlib.pyplot as plt
import numpy as np
There is some code here but that just defines the data of the sound wave and has nothing to do with my question.
data_fft = np.fft.fft(data)
frequencies = np.abs(data_fft)
print("The frequency is {} Hz".format(np.argmax(frequencies)))
frequency1 = frequencies - np.argmax(frequencies)
print(np.argmax(frequency1))
I can not figure out how to remove the highest frequency value. The code I showed returns 4561 as the highest value in frequencies and then I try to subtract that out in the new variable frequency1. When I print out the np.argmax of that I still get 4561. Does anyone know how I can remove this value?