필터 지우기
필터 지우기

Extracting Data for Sound Generation

조회 수: 1 (최근 30일)
Arjun Tandon
Arjun Tandon 2020년 5월 16일
I'm trying to extract data from a large file and play it as a sound. I've written up a code that resembles the data I'm dealing with, but I'm not sure how I can extract the data.
%Creates three abitrary matrices (resembles the data I'm working with)
for i = 1:100
for j = 1:100
A(i,j) = sin(i*j);
B(i,j) = cos(i*j);
for k = 1:10
C(i,j,k) = i+j+k;
end
end
end
%Normalizes the data
Astar = A/(abs(A));
Bstar = B/(abs(B));
%% Plotting
surf(Astar,Bstar);
xlabel('x')
ylabel('y')
zlabel('z');
colormap('parula');
The plotting (below) lets me see the data as in 3D environment (essentially the waveform as it varies in time), and I'm trying take the data on the planes x=1, 2, 3, 4... and collapse them into a single plane (e.g. x = 0) so I can take the data (which should be 2D now) and run it through my sound-producing code. (

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by