How to get the power spectral density from a Spectrogram in a given frequency range?

조회 수: 21 (최근 30일)
In the figure I have uploaded for example, is there a function to get the Power spectral density of the signal between 1 - 2 Hz? I think that I need the matrix of numbers used by Matlab to generate the Spectrogram. Is it stored in the variable S considering I used the line: [S,F,T,P] = spectrogram(x1,w,2400,2800,Fs); to generate the spectrogram?

답변 (1개)

Youssef  Khmou
Youssef Khmou 2014년 3월 20일
This problem is simple in terms of matrix manipulation, all what you need is the index corresponding to the desired range, let us take an example :
F=rand(100,40);
suppose the frequency is represented by the is the x (40), if i want choose the range 22:25 :
G=F(:,22:25);
  댓글 수: 2
Win
Win 2014년 3월 20일
Ok, thanks for your reply. I've never calculated the energy of a signal before. Do I need to use the function periodogram for it?
Youssef  Khmou
Youssef Khmou 2014년 3월 20일
ok, here is an example using modulated sinusoidal signal :
t = 0:0.001:2;
x = chirp(t,150,1,300);
The number of points for frequency is :
f=0:0.1:150; % example
Code for computing the PSD :
[y,f,t,P]=spectrogram(x,10,6,f,1E3);
figure; surf(t,f,10*log10(abs(P)),'EdgeColor','none');
view(0,90);
xlabel('times s');
ylabel(' frequency Hz');
to choose per example the range 50,100Hz, you need the information of theirs indexes :
x1=500;
x2=1000;
F=P(x1:x2,:);
figure; surf(20*log10(F));

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by