Why does rref() make a sound sample sound different?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mara Gati
el 3 de Mayo de 2016
Comentada: Mara Gati
el 6 de Mayo de 2016
I was messing around the other day and ended up with the following code:
load handel
h = [y;Fs];
h = h';
d = rref(h);
sound(d)
What does rref() do to make it sound like that?
0 comentarios
Respuesta aceptada
Star Strider
el 3 de Mayo de 2016
It depends on how you give rref the matrix. (Stereo sound files are (Nx2) matrices.)
If you give it as the two-column matrix, you get the result that John describes. If you transpose the matrix (to (2xN), you get an entirely different result.
Experiment:
t = linspace(0, 2)';
M = [sin(2*pi*t) cos(2*pi*t)]; % Create Data
figure(1)
subplot(2,1,1)
plot(t, M)
hold on
plot(t, rref(M), '--')
hold off
grid
subplot(2,1,2)
plot(t, M)
hold on
plot(t, rref(M'), '--')
hold off
grid
0 comentarios
Más respuestas (1)
John D'Errico
el 3 de Mayo de 2016
Why in the name of god and little green apples would you bother to do this? rref is a linear algebra tool, normally applied to matrices, for a specific purpose. Throwing random numbers into a random function will yield randomly meaningless (and useless) results.
d is a column vector as you create it. rref will take ANY column vector with at least one non-zero element, and return a vector which is entirely zero, except that the first element is 1.
When you then put that into the sound function, it sounds as it does.
Ver también
Categorías
Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!