给出时域信号。我可以针对特定频率并包含特定时滞(或相位)来分离其频谱吗?
我有一个采样信号,奈奎斯特范围为250 Hz。我只需要选择0到20 Hz的频率范围以及20毫秒的时移即可。
采样频率为500,采样速率为2毫秒。 3001个样本的总记录长度为6秒 谢谢
fs=500; %sampling freqeuncy
x=testshot3.traces(:,1);% discrete signal 1D.taking out one signal
slen=length(x);
nfft = 2^nextpow2(2*slen); % To use max. computational efficiency of FFT
fax = fs*(-nfft/2:nfft/2-1)'/nfft; % Create frequency shift vectors(bins)
kk=20; %lag to find 20 msec.remeber sample rate is 2 msec. so this would come as 10th sample
FX=fft(x,nfft);%fft of the the 2D signal x
A=abs(FX);%amplidue of x
ff=find(round(fax)>=-20 & round(fax)<=20 );% finding frequency bins from -20 to 20 Hz
l_ff=length(ff);%length of selected freguency bins
% setting condition for filter: Frequency and lag
for j=1:1: l_ff % rows of frequency range
fx_real=abs(real(fx(ff(j,1),1)));% frequency values real part
ee=abs(real(exp(1i*2*pi*fax(ff(j,1),1)))); % exp part
dn=A(ff(j,1),1).*ee; % frequency bin value for real part
lags=fx_real./dn; % find lag
if round(lags)==round(abs(exp(kk*pi)))% condition
FX=0.01*FX(ff(j,1),1);
end
end
dum = ifft(FX_all); % Return to time domain
filter= real(dum(1:slen,:));