我已经有了一个FFT幅度的光谱和我想创建一个过滤器,从它有选择性地通过定期的噪声的来源(例如正弦波刺)和零出的频率相关联的随机的背景噪音。我明白了急剧的转变的频率域将创造响的文物一旦这个过滤器被送回到该时间域...所以我想知道是否有任何规则的拇指怎么顺利的过渡,在这样一个过滤器,避免这样的铃声。

例如,如果FFT有1M的频率,并有五个刺戳出来的背景噪声言,我想要零所有的垃圾桶除峰值站每一个相关的五个刺。问题是如何处理相邻正垃圾箱,以防止文物的时间域。例如,应该站在每一侧的一个正站被设定为50%的幅度?应该有两箱的两侧的一个正站被用(最近的一个在50%,下一个最近25%,等等。)?任何想法极大的赞赏。谢谢!

有帮助吗?

解决方案

我喜欢以下方法:

  • 创造理想幅度频谱(记住以使它对称的关于DC)
  • 逆变换的时间域
  • 旋转块半blocksize
  • 适用一个汉恩窗口

我觉得它创建合理流畅的频率域的结果,虽然我从来没有尝试过的东西作为尖锐,因为你的建议。你也许可以做出一个更清晰的过滤器使用Kaiser-贝塞尔的窗口,但是你必须挑选参数适当地进行。通过更清晰的,我猜也许你可以减少旁瓣6dB。

这里是一些样品Matlab/倍频程代码。测试结果,我用 freqz(h, 1, length(h)*10);.

function [ht, htrot, htwin] = ArbBandPass(N, freqs)
%# N = desired filter length
%# freqs = array of frequencies, normalized by pi, to turn into passbands
%# returns raw, rotated, and rotated+windowed coeffs in time domain

if any(freqs >= 1) || any(freqs <= 0)
    error('0 < passband frequency < 1.0 required to fit within (DC,pi)')
end

hf = zeros(N,1); %# magnitude spectrum from DC to 2*pi is intialized to 0
%# In Matlabs FFT, idx 1 -> DC, idx 2 -> bin 1, idx N/2 -> Fs/2 - 1, idx N/2 + 1 -> Fs/2, idx N -> bin -1
idxs = round(freqs * N/2)+1; %# indeces of passband freqs between DC and pi
hf(idxs) = 1; %# set desired positive frequencies to 1
hf(N - (idxs-2)) = 1; %# make sure 2-sided spectrum is symmetric, guarantees real filter coeffs in time domain
ht = ifft(hf); %# this will have a small imaginary part due to numerical error
if any(abs(imag(ht)) > 2*eps(max(abs(real(ht)))))
    warning('Imaginary part of time domain signal surprisingly large - is the spectrum symmetric?')
end
ht = real(ht); %# discard tiny imag part from numerical error
htrot = [ht((N/2 + 1):end) ; ht(1:(N/2))]; %# circularly rotate time domain block by N/2 points
win = hann(N, 'periodic'); %# might want to use a window with a flatter mainlobe
htwin = htrot .* win;
htwin = htwin .* (N/sum(win)); %# normalize peak amplitude by compensating for width of window lineshape
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top