How do I obtain a waveform of a note on MATLAB?

3 ビュー (過去 30 日間)
Connor Mondock
Connor Mondock 2022 年 4 月 8 日
回答済み: Voss 2022 年 4 月 8 日
clear
audioinfo("Recording_Guitar.m4a")
The sampling rate of this note is 48000
f_s = 48000;
T = 1/f_s;
N = 0.5*f_s;
n = @(L) 1:L*N;
note = @(L, f_n) sin(2*pi*f_n*n(L)*T)
I used the audioinfo function to obtain the sampling rate of a note and now I want to use the audioread function to create a vector to store the digital waveform. How would I do that? I already just tried using the audioread command with the recording file, but it gave a 100000 x 2 vector or something.

回答 (1 件)

Voss
Voss 2022 年 4 月 8 日
audioread returns a 100000 x 2 matrix because the file contains 100000 samples in each of 2 channels, i.e., it's a stereo recording.

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by