(New page: Fs = 44100; % Sampling Frequency in Hz y = wavread('armstrong'); % Reads the armstrong.wav file specificed by a string file wavplay(y,Fs); % Plays the armstrong.wav file at the specified s...) |
|||
Line 1: | Line 1: | ||
Fs = 44100; % Sampling Frequency in Hz | Fs = 44100; % Sampling Frequency in Hz | ||
+ | |||
y = wavread('armstrong'); % Reads the armstrong.wav file specificed by a string file | y = wavread('armstrong'); % Reads the armstrong.wav file specificed by a string file | ||
+ | |||
wavplay(y,Fs); % Plays the armstrong.wav file at the specified sampling frequency | wavplay(y,Fs); % Plays the armstrong.wav file at the specified sampling frequency | ||
+ | |||
x = wavread('armstrongforward'); % Reads the armstrongforward.wav file specificed by a string file | x = wavread('armstrongforward'); % Reads the armstrongforward.wav file specificed by a string file | ||
+ | |||
wavplay(x,Fs); % Plays the armstrongforward.wav file at the specified sampling frequency | wavplay(x,Fs); % Plays the armstrongforward.wav file at the specified sampling frequency | ||
+ | |||
N = length(x); % Returns the length of vector x. | N = length(x); % Returns the length of vector x. | ||
+ | |||
k = 1:1:N; % Creates an array | k = 1:1:N; % Creates an array | ||
+ | |||
minus_k = N+1 - k; % Reverses the created array | minus_k = N+1 - k; % Reverses the created array | ||
+ | |||
z = x(minus_k); | z = x(minus_k); | ||
+ | |||
wavplay(z,Fs); % Plays the reversal of armstrongforward.wav file | wavplay(z,Fs); % Plays the reversal of armstrongforward.wav file | ||
+ | |||
w = zeros(1,2.*N); | w = zeros(1,2.*N); | ||
+ | |||
w(1:2:2.*N) = z(1:N); | w(1:2:2.*N) = z(1:N); | ||
+ | |||
wavplay(w,Fs); % Plays the slowed & reversed version of armstrongforward.wav file | wavplay(w,Fs); % Plays the slowed & reversed version of armstrongforward.wav file |
Revision as of 20:41, 22 July 2008
Fs = 44100; % Sampling Frequency in Hz
y = wavread('armstrong'); % Reads the armstrong.wav file specificed by a string file
wavplay(y,Fs); % Plays the armstrong.wav file at the specified sampling frequency
x = wavread('armstrongforward'); % Reads the armstrongforward.wav file specificed by a string file
wavplay(x,Fs); % Plays the armstrongforward.wav file at the specified sampling frequency
N = length(x); % Returns the length of vector x.
k = 1:1:N; % Creates an array
minus_k = N+1 - k; % Reverses the created array
z = x(minus_k);
wavplay(z,Fs); % Plays the reversal of armstrongforward.wav file
w = zeros(1,2.*N);
w(1:2:2.*N) = z(1:N);
wavplay(w,Fs); % Plays the slowed & reversed version of armstrongforward.wav file