Why does rref() make a sound sample sound different?

1 次查看(过去 30 天)
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?

采纳的回答

Star Strider
Star Strider 2016-5-3
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

更多回答(1 个)

John D'Errico
John D'Errico 2016-5-3
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.

类别

Help CenterFile 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