簡體   English   中英

如何從 FFT 中找到峰值和相應的頻率?

[英]How do I find the Peaks and the corresponding frequencies from the FFT?

我已經獲得了以下 FFT:

原始FFT:
在此處輸入圖片說明

我想知道如何將前九個峰值及其相應的頻率提取到兩個數組中。 我有另一個類似的 FFT(用於電壓),我想做同樣的事情,然后對它們執行數學運算。

我想知道(如果可能的話,請詳細說明)如何提取峰值和頻率。

例如,如果你有兩個數組

a = [1,2,3] #where you want to find the peak
b = [4,5,6] #the corresponded frequency 

你可以找到 a 的最大值

max_a = max(a)
index = a.index(max_a)
frequency = b[index]

完整代碼:

max_list = []
for _ in range(9):
    max_a = max(a)
    index = a.index(max_a)
    frequency = b[index]
    max_list.append((max_a,frequency)) #value of that a and that frequency
    a.pop(index)
    b.pop(index)

最終產品將是

max_list = [(a,b),(c,d),...]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM