How to solve this expression with code (python)?

brolija

New member
Joined
Sep 12, 2019
Messages
1
I am having trouble understanding this expression:
69901052_970862343259638_1294387561149497344_n.jpg

####################################### MY TRY
PSD is a 1D array of n amplitudes
fft_freq is a 1D array n frequencies

threshold = 0.2*np.max(PSD)...................................# Condition
ls = []
for i in range(n):
.....if PSD < threshold:.............................................# If PSD(f) passes the condition, then add amplitude to list
........ls.append(PSD)
idx = np.where(np.max(ls)==PSD)[0][0]....................# Find which frequency corresponding to the maximum amplitude in the list
freq_ax = fft_freq[idx]
#######################################

But the answer is not reasonable at all (it's higher than the f_mean).. I must have misunderstood the expression.
Someone that know how to interpret this?
 
Just a couple of ideas.

1) Why would f_max NOT be greater than f_mean?
2) Can't you just create an index and sort the thing if all you want is the index of the maximum?
 
Top