How do i read audio and include it in my function?

์กฐํšŒ ์ˆ˜: 1 (์ตœ๊ทผ 30์ผ)
Farah Hani
Farah Hani 2020๋…„ 11์›” 20์ผ
๋‹ต๋ณ€: Nora Khaled 2020๋…„ 11์›” 20์ผ
i need to plot a graph that shows
y=y1+1ร—r(t)
๐‘ฆ1=sin(2๐œ‹๐‘“๐‘ก+๐œ‹/4)
r(t): read from audio file
but my problem is i don't know include the r(t) into my program.
the program i know so far is
fs=1000;
t=0:1/fs:1;
f=440;
y=y1+1*rt
y1=sin(2*pi*f*t+pi/4);
sound(y,fs)
N=1+0.1*fs;
n=1:N;
plot(t(n),y(n))
xlabel('Time(s)')
ylabel('Amplitude')

๋‹ต๋ณ€ (1๊ฐœ)

Nora Khaled
Nora Khaled 2020๋…„ 11์›” 20์ผ
check out this function
it reads data from the file named filename, and returns sampled data, y, and a sample rate for that data, Fs.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File 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