(→Sounds Files) |
(→Sounds Files) |
||
Line 4: | Line 4: | ||
[http://kiwi.ecn.purdue.edu/ECE301Fall2008mboutin/images/1/1d/Judas_Reverse_22050HZ.wav Judas Reverse @ 22050HZ] | [http://kiwi.ecn.purdue.edu/ECE301Fall2008mboutin/images/1/1d/Judas_Reverse_22050HZ.wav Judas Reverse @ 22050HZ] | ||
+ | |||
+ | |||
+ | == Matlab Code == | ||
+ | |||
+ | clear | ||
+ | clc | ||
+ | fileInput = 'jpforward.wav'; %Input file | ||
+ | origArray = wavread(fileInput); %Array containing input file | ||
+ | |||
+ | inputLength = length(origArray); %gets length of array | ||
+ | count = 1; %Initializes counter | ||
+ | |||
+ | for count = 1:inputLength; %Simply reverses the array using a loop | ||
+ | outputArray(inputLength - count + 1) = origArray(count); | ||
+ | end | ||
+ | |||
+ | %Sampling rates used: 44100HZ and 22050HZ | ||
+ | wavplay(outputArray, 44100); %Plays the sound file | ||
+ | wavplay(outputArray, 22050); | ||
+ | wavwrite(outputArray, 44100, 'Judas Reverse_44100HZ'); %Saves sound file | ||
+ | wavwrite(outputArray, 22050, 'Judas Reverse_22050HZ'); |
Revision as of 13:26, 4 September 2008
Sounds Files
Matlab Code
clear clc fileInput = 'jpforward.wav'; %Input file origArray = wavread(fileInput); %Array containing input file
inputLength = length(origArray); %gets length of array count = 1; %Initializes counter
for count = 1:inputLength; %Simply reverses the array using a loop
outputArray(inputLength - count + 1) = origArray(count);
end
%Sampling rates used: 44100HZ and 22050HZ wavplay(outputArray, 44100); %Plays the sound file wavplay(outputArray, 22050); wavwrite(outputArray, 44100, 'Judas Reverse_44100HZ'); %Saves sound file wavwrite(outputArray, 22050, 'Judas Reverse_22050HZ');