matlab 功率谱密度

clear all


fs=50;  %---------采样频率

nfft=1024;%-------fft点数

ser_target=20; %单边谱

x=sqrt(ser_target/2*fs)*randn(1,10000); %noise history

[px2,fx2]=pwelch(x,hanning(nfft),nfft/2,nfft,fs);

semilogy(fx2,px2,'r')

s_er=var(x)/fs*2 %单边谱验证


你可能感兴趣的:(matlab 功率谱密度)