How to get the power spectral density from a Spectrogram in a given frequency range?
9 次查看(过去 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159149/image.png)
0 个评论
回答(1 个)
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 个评论
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 Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!