how we get to power matrix from spectrogram?

4 次查看(过去 30 天)
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
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

类别

Help CenterFile Exchange 中查找有关 Time-Frequency Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by