how to plot the audio into sample?

4 ビュー (過去 30 日間)
Manjutha Manavalan
Manjutha Manavalan 2016 年 10 月 1 日
コメント済み: Walter Roberson 2016 年 10 月 1 日
clc;
clear all;
close all;
fileName='Voice_002.wav';
[y, fs, nbits]=wavread(fileName);
N = length(y);% % N is the number of samples
sound(y, fs); % Playback of the sound data
time=(1:length(y))/fs; % Time vector on x-axis
plot(time,y);xlabel('Time');
ylabel('Amplitude'); % Plot the waveform w.r.t. time
fprintf('Information of the sound file "%s":\n', fileName);
fprintf('Duration= %g seconds\n', length(y)/fs);
fprintf('Number of samples %g:\n', N);
fprintf('Sampling rate = %g samples/second\n', fs);
fprintf('Bit resolution = %g bits/sample\n', nbits);
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 10 月 1 日
? Your line
plot(time,y)
already appears to be plotting the samples.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio Processing Algorithm Design についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by