how we get to power matrix from spectrogram?

in my project i display a spectrogram in matlab (time, frequency and power). i neet to show the power matrix. how can i do it?
this is my code:
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Spectrogram %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Data2 is the data with a function of y = 1/(x^3) for dealing with the different strength levels of the data (the data is weak while the target is far from the radar and strong when the target is near the radar).
fs = 10000 ;
window = 512 ; % The number of sumples at every window in the spectrogram function
overlap = 500 ; % Number of overlap samples
nfft = window*8 ;
% The spectrogram function :
spectrogram(data,blackman(window),overlap,nfft,fs,'yaxis'); %display of the spectrogram
% New y axe. Converting the frequency axe to Velocity axe :
const = ( (299792458)/(2*f_transmit) ) ;%0.001595 ;
yticks( [0:1:10]/(const*1000) ) ;
yticklabels( { [0:1:10] } ) ;
% Titles for the image
xlabel('\fontsize{24} T[s]');
ylabel('\fontsize{24} V[m/s]');
set(gca,'FontSize',20); % Font of the numbers in the axes
colormap jet
and this is one of the records in spectrogram

답변 (1개)

Binaya
Binaya 2023년 10월 5일

0 개 추천

Hi Orly,
I understand your objective is to plot the power spectrum of the audio you are analyzing. Given that you already have the audio data from which a spectrogram was generated, you can directly employ the "pspectrum" function available in MATLAB to generate the power spectrum of the audio.
Please refer to the following link for “pspectrum” documentation:
I hope this addresses your question.
Regards
Binaya

카테고리

도움말 센터File Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

태그

질문:

2022년 4월 25일

답변:

2023년 10월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by