how we get to power matrix from spectrogram?

6 views (last 30 days)
orly mishayev
orly mishayev on 25 Apr 2022
Answered: Binaya on 5 Oct 2023
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

Answers (1)

Binaya
Binaya on 5 Oct 2023
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

Categories

Find more on Time-Frequency Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!