Spectrogram of Audio Signal

21 次查看(过去 30 天)
Hello,
I have a audio Signal , and have to plot the spectrogram of that Signal.
After coding, I have Fs=44100 and Sound signal= 448064*1
How can I plot this as both the matrix size does not match.
Please help me out
Thanks in Advance
clc;
clear all;
close all;
[y,Fs]= audioread('1kdrei.wav');
dt=1/Fs;
y_1= y(:,1);
win=hamming(512);
windowsize=256;

采纳的回答

Bjorn Gustavsson
Bjorn Gustavsson 2021-7-30
Have a look at the help and documentation of the spectrogram function. That allows you to calculate the spectrogram as such:
[S,F,T] = spectrogram(y(:,1),windowsize,windowsize/4,[],Fs);
Then you can plot the spectrogram using pcolor:
pcolor(T,F,log10(abs(S))),shading flat,colorbar
HTH

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by