Why does rref() make a sound sample sound different?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mara Gati
am 3 Mai 2016
Kommentiert: Mara Gati
am 6 Mai 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 Kommentare
Akzeptierte Antwort
Star Strider
am 3 Mai 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 Kommentare
Weitere Antworten (1)
John D'Errico
am 3 Mai 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.
Siehe auch
Kategorien
Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!