How to get gussian noise spectrum using FFT?Why the Noise spectral density is so low?

1 view (last 30 days)
%%My code
fs = 1e3;
t =1:1:1024;
y1 = 1*sin(2*pi*79*t/fs)+1*(randn(1 ,1024));
y = y1.*hanning(1024)';
y = signal + noise;
y_fft = abs(fft(y,1024))/1024;
f = linspace(0,1,513);
plot(f*fs/2,20*log10(y_fft(1:513))+3),grid on;
%%Hi all,the rms value of the noise is 1,so the Noise spectral density should be 20*log10(1^2)=0dB ? %% %% if not, why? Thanks~%%

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!