Spectrogram of Audio Signal

조회 수: 159 (최근 30일)
Mangesh KAle
Mangesh KAle 2021년 7월 30일
답변: Bjorn Gustavsson 2021년 7월 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에서 Time-Frequency Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by