当存在频谱泄漏时,如何找到每个频率的粗略(尽可能准确)幅度。目前,我正在处理一个包含特殊泄漏的系统,这似乎是不可避免的,因为我正在测量具有任何可能频率的真实信号。目前,即使有泄漏,我也可以将分量频率识别到相当准确的水平,但我找不到这个频率的幅度,因为能量分布在多个频率区间。
是否有可能直接从 FFT 或使用识别的频率后记得到频率幅度的粗略预测?
我一直在尝试使用 Windowing,发现这很有用。 https://www.youtube.com/watch?v=VxTx9QW8Zx8&ab_channel=Adash 使用 Hann 窗口并使用频率校正方程。它给出了很好的频率近似值,但没有幅度或相位。
当前用于测试和生成光谱的代码示例。
import numpy as np
def gendata(FreqR,AmplR ,Ssize):
PhaseR = np.pi # phase range
FreqR = (FreqR*10) +1
AmplR = (AmplR*100)+1
PhaseR = (PhaseR*100)+1
freq_OR = []
ampl_OR= []
phase_OR =[]
for i in range(Ssize):
freq_OR. append((((FreqR-1)/Ssize)*(i+1)/10)) # currently just equaly spread but can be any value between 0-9 rad/s
ampl_OR.append(1) # unit amplitude to check for variation and error.
phase_OR.append(np.random.randint((-PhaseR),(PhaseR))/100) # random phase
return(freq_OR,ampl_OR,phase_OR)
def pltsignal(freq_OR,ampl_OR,phase_OR,t_OR):
z = 0 # original signal flat sea's
if len(freq_OR) == len(ampl_OR):
for i in range(len(freq_OR)): # for each frequency generate a regular wave.
wave_OR = ampl_OR[i] * np.cos(2*np.pi*freq_OR[i]*t_OR + phase_OR[i]) # generated wave signal using the frequncy, amplitude and phase of each wave.
z = z + wave_OR # superpostion each wave ontop of each other.
else:
print("amplutide and frequency are diffrent lengths")
return z # returns superimposed irregular wave.
FreqR = 1.5 # htz or (9 rad/s ish)
AmplR = 1 # currently unit amplitude to measure the error
Size = 12 # sample size, also used to move around frequencies
E_OR = 20 # time over wich signal is measured (max values is about 120 ish)
Fs = 6 # Sample rate in Hz
t_OR = np.arange(0,E_OR,1/Fs) # starts at 0, ends at E, steps by 1/Fs
data_OR = gendata(FreqR,AmplR,Size)
z = pltsignal(data_OR[0],data_OR[1],data_OR[2],t_OR) # original signal ( simulation of mesurment )
# anaysisng the signal using NumPy fft, then scaling and finding peaks.
Ramp = np.fft.fft(z) #real aplitudes used to find phase
Rfeq = np.fft.fftfreq(z.shape[-1]) #real frequency domain to find phase
信号模型:
$$ x \left( t \right) = \sum_{i = 1}^{M} {a}_{i} \cos \left( 2 \pi {f}_{i} t + {\phi} _{i} \right) + n \left( t \right) $$
其中$ M, {\left\{ {a}_{i} \right\}}_{i = 1}^{M}, {\left\{ {f}_{i} \right\}}_ {i = 1}^{M}, {\left\{ {\phi}_{i} \right\}}_{i = 1}^{M} $是未知参数,$ n \left( t \右)$是加性高斯白噪声(AWGN)。
可以假设:
- SNR 非常非常高。
- 观察时间为~
120 [Sec]
。 - 信号数量为 1-20。
- 频率高达
2 [Hz]
. - 频率之间的差距可以小到
0.005 [Hz]
。