Power Spectrum of Colored Noises

조회 수: 1 (최근 30일)
Nycholas Maia
Nycholas Maia 2018년 1월 17일
답변: Greg Dionne 2018년 2월 2일
Hi, I would like to know how to "normalize" the power spectrum of FFT so that the length of the colored noise doesn't affect the amount of power ploted.
Example below: When I change the value of 'duration', the final plot will show a different amount of energy. I understand that this is a cumulative sum, but I would like to get a normalized version of the plot for all signals.
How can I do that?
% Sample Rate:
Fs = 48000;
% Duration (seconds):
duration = 10;
% Signal Length:
L = Fs * duration;
%%Generate Colored Noise:
generator = dsp.ColoredNoise(0, L);
% Get the white noise signal:
white_noise = generator();
%%Normalize the signal between [-1 +1]:
white_noise = white_noise/max(abs(white_noise));
%%FFT:
Y = fft(white_noise);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
%%Plot:
f = Fs*(0:(L/2))/L;
plot(f,P1)
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')

채택된 답변

Greg Dionne
Greg Dionne 2018년 2월 2일
I think you're looking for a PSD.
Try periodogram(white_noise) or periodogram(white_noise,[],[],Fs)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by