clear all
clc
N=96; % length of sequence
M=48; % length of filter
L=N-M+1; % number of snap shots
Fs = 1; % Sampling frequency
Ts = 1/Fs; % Sample time
Lx = 1056; % Length of signal
t = (0:Lx-1)*Ts; % Time vector
w = 0; % frequency that filter passes the xn without distortion
A = [1 1 1 0.2 1 0.1 0.1]; % Sinusoid amplitudes
f =[0.90;0.102;0.240;0.350;0.370;0.390;0.415]; % Sinusoid frequencies
signal=A*sin(2*pi*f*t); % signal
noise= 0.1.*randn(size(t)); % noise
data=signal+noise; % data=signal+noise
xn=[];
y=[];
Yw=[];
for n=0:ceil(Lx/N)-1 % product data sequence
for m=1:N
xn(n+1,m)=data(1,n*N+m);
end
end
for n=0:ceil(Lx/N)-1 % product y(l) , l=1,...,L
for m=1:L
y(n*L+m,:)=xn(n+1,m:m+M-1);
end
end
for n=0:ceil(Lx/N)-1
for m=1:L
Yw(n+1,:)=Yw+y(n*L+m,:).*exp(-i*w*m)./L;
end
end
% NFFT = 2^nextpow2(L); % Next power of 2 from length of y
% X = fft(xn,NFFT)/L;
% F = Fs/2*linspace(0,1,NFFT/2+1);
% plot(F,2*abs(X(1:NFFT/2+1)))
% R=cov(xn); % sample covariance
% sigma2=var(n); % variance of noise
% T=(1+sigma2); % tuning factor
% R_tuning=T*R; % tuning sample covariance
% Q_tuning=T*R-X*conj(X');
% w=2*pi*100; % frequency without distortion
% a=[];
% for j=1:M
% a=[a,exp(i*w*(j-1))];
% end
% h_ATAPES=(Q_tuning^(-1)*a)/(conj(a')*Q_tuning^(-1)*a);
ATAPESmethod.rar_APES_high_location estimation_spectral peak
版权申诉
105 浏览量
2022-07-14
21:24:15
上传
评论
收藏 834B RAR 举报
![avatar](https://profile-avatar.csdnimg.cn/823be93c18be4b9fa55c75bb75c369e0_weixin_42659791.jpg!1)
Kinonoyomeo
- 粉丝: 77
- 资源: 1万+
评论0