Sir i tried to plot a spectrogram for an audio . it showing error.

4 ビュー (過去 30 日間)
Suchithra K S
Suchithra K S 2018 年 11 月 27 日
コメント済み: Vaishnavi 2023 年 10 月 31 日
This is my code:
function outputSpectrogram(input)
[audio, fs] = audioread('asianelephantspeaker.wav');
audioMono = (audio(:, 1) + audio(:, 2)) / 2;
spectrogram(audio, 256, [], 25, 2000, 'yaxis');
title('rumble')
end
The error is like this "outputspectrogram
Error using spectrogram>chkinput (line 252)
X must be a vector (either row or column).
Error in spectrogram (line 166)
chkinput(x);
Error in outputspectrogram (line 5)
spectrogram(audio, 256, [], 25, 2000, 'yaxis');
>> "
How i will rectify this error?
and I will also attach my audio with this.
  1 件のコメント
Image Analyst
Image Analyst 2018 年 11 月 27 日
OK, we'll check back later for the audio file.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2018 年 11 月 27 日
編集済み: Jan 2018 年 11 月 27 日
[audio, fs] = audioread('asianelephantspeaker.wav');
audioMono = (audio(:, 1) + audio(:, 2)) / 2;
spectrogram(audioMono, 256, [], 25, 2000, 'yaxis');
% ^^^^ the "Mono" was missing
  2 件のコメント
Suchithra K S
Suchithra K S 2018 年 11 月 28 日
ok thank you sir.
Vaishnavi
Vaishnavi 2023 年 10 月 31 日
That was really helpful. Thank you so much!!!!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTime-Frequency Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by