Extracting Data for Sound Generation

1 vue (au cours des 30 derniers jours)
Arjun Tandon
Arjun Tandon le 16 Mai 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. (

Réponses (0)

Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by