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

22 次查看(过去 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