关于白噪声的两个问题:频谱估计 和 与其他信号的卷积的频谱估计
问题描述:某信号x具有频谱X,x和白噪声wn作卷积后生成x_conv,再作频谱估计得到X_CONV,理论上应该和X一样,但是我做出来的却不一样:1、最大值不同;2、有泄漏现象。
关于问题1,我单独写了一段程序,发现当对白噪声作分段频谱估计的时候,却与生成白噪声的频谱WN的不一样。
关于问题2,这种泄漏现象是怎样造成的,怎样才能生成下图 白噪声卷积MATLAB脚本
clc
clear all
close all
lg = inline('10*log10(abs(squeeze(x)))','x');
%% 生成伪随机信号
N = 1024; %数据点数
X = ones(N,1)*10^(-10);
X(51:200) = ones(150,1);
RandPhas = exp(j*(rand(N,1)*2*pi)); %随机相位
X = X.*RandPhas;
X(N/2+2:end) = conj(X(N/2:-1:2)); %频谱作“共轭对称”处理
x = ifft(X,'symmetric')*N; %伪随机信号生成
figure(1)
subplot(2,1,1)
plot(lg(X))
title('伪随机信号')
ylabel('Amp dB');
axis tight
subplot(2,1,2)
plot(x)
axis tight
%% 生成白噪声
N1 = 100*N;
WN = ones(N1,1);
RandPhas = exp(j*(rand(N1,1)*2*pi));
WN = WN.*RandPhas;
WN(N1/2+2:end) = conj(WN(N1/2:-1:2));
wn = ifft(WN,'symmetric')*N1;
%wn = wn-mean(wn);
figure(2)
subplot(2,1,1)
plot(lg(WN))
title('白噪声')
ylabel('Amp dB');
axis tight
subplot(2,1,2)
plot(wn)
axis tight
x_conv = conv(x,wn);
len = length(x_conv);
ave = floor(len/N);
X_CONV = zeros(N,1);
for i = 1:ave
tmp = x_conv((i-1)*N+(1:N));
TMP = fft(tmp)/N;
X_CONV = X_CONV+abs(TMP);
end
X_CONV = X_CONV/ave;
figure(3)
plot(lg(X_CONV));
title('卷积信号的频谱')
ylabel('Amp dB');
axis tight 上面脚本的结果: 关于白噪声分段频谱估计的程序及结果:
clc
clear all
close all
lg = inline('10*log10(abs(squeeze(x)))','x');
N = 1024;
N1 = 100*N;
WN = ones(N1,1);
RandPhas = exp(j*(rand(N1,1)*2*pi));
WN = WN.*RandPhas;
WN(N1/2+2:end) = conj(WN(N1/2:-1:2));
wn = ifft(WN,'symmetric')*N1;
ave = N1/N;
WN2 = zeros(N,1);
for i = 1:ave
tmp = wn((i-1)*N+(1:N));
TMP = fft(tmp)/N;
WN2 = WN2+abs(TMP);
end
WN2 = WN2/ave;
figure(1)
plot((1:N1)/100,lg(WN),'g',1:N,lg(WN2),'b');
ylabel('Amp dB');
axis tight; 小弟的信号处理是自学的,学的不到家,在上面的问题上停步了很久:@Q ,请高手指点迷津,小弟在此先谢过了:@) :@( 请大家给点提示吧,我自己也在想,但终不得其解:@Q :@Q :@Q :@Q
页:
[1]