Clear Filters
Clear Filters

Extracting Data for Sound Generation

1 view (last 30 days)
Arjun Tandon
Arjun Tandon on 16 May 2020
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. (

Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!