(New page: == Reversed Judas Priest == == Results == When the song is played forwards, the words are "Beyond the realms of death." When reversed, the band sings "I took my life." == Matlab C...) |
(→Matlab Code) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Reversed Judas Priest == | == Reversed Judas Priest == | ||
+ | * Reversed Normally | ||
+ | [[Media:Jpreverse1_ECE301Fall2008mboutin.wav| here!]] | ||
+ | |||
+ | * Reversed with Padding | ||
+ | |||
+ | [[Media:Jpreverse2_ECE301Fall2008mboutin.wav| here!]] | ||
== Results == | == Results == | ||
Line 11: | Line 17: | ||
== Matlab Code == | == Matlab Code == | ||
+ | |||
+ | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br> | ||
+ | % Kathleen Schremser %<br> | ||
+ | % ECE 301 %<br> | ||
+ | % Homework 1, due Friday, September 5, 2008 %<br> | ||
+ | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br> | ||
+ | <br> | ||
+ | % Clear the screen <br> | ||
+ | clear<br> | ||
+ | clc<br> | ||
+ | <br> | ||
+ | % Define the filename, assuming the file is called "jpforward", it is a<br> | ||
+ | % .wav file, and it is in the PWD<br> | ||
+ | file = 'jpforward.wav';<br> | ||
+ | <br> | ||
+ | % Convert music (?) to Matlab data:<br> | ||
+ | % data = digital signal, Fs = Frequency, nbits = number of bits per sample<br> | ||
+ | [data, Fs, nbits] = wavread(file);<br> | ||
+ | <br> | ||
+ | % Play the file<br> | ||
+ | %wavplay(data, Fs)<br> | ||
+ | <br> | ||
+ | % Find the length of the data, and save it as two different variables (to<br> | ||
+ | % be used while looping)<br> | ||
+ | L = length(data);<br> | ||
+ | Ll = L;<br> | ||
+ | <br> | ||
+ | % Create two arrays that will be able to hold the data once reversed, one<br> | ||
+ | % for the regular reversal and one for the padded reversal<br> | ||
+ | Reverse = ones(size(data));<br> | ||
+ | Reverse2 = ones(size(data*2)+1);<br> | ||
+ | <br> | ||
+ | % Reverse the data and play the result<br> | ||
+ | for i = 1:L | ||
+ | Reverse(i) = data(Ll); | ||
+ | Ll = Ll - 1; | ||
+ | end<br> | ||
+ | %wavplay(Reverse, Fs)<br> | ||
+ | |||
+ | % Now pad the data with 0s and play the result | ||
+ | i=1; | ||
+ | for j = 1:L | ||
+ | Reverse2(i) = Reverse(j); | ||
+ | Reverse2(i+1) = 0; | ||
+ | i = i + 2; | ||
+ | end<br> | ||
+ | %wavplay(Reverse2, Fs)<br> | ||
+ | |||
+ | % Create the file with the reversed sound<br> | ||
+ | wavwrite(Reverse, Fs, 'jpreverse1')<br> | ||
+ | wavwrite(Reverse2, Fs, 'jpreverse2')<br> |
Latest revision as of 16:27, 4 September 2008
Reversed Judas Priest
- Reversed Normally
- Reversed with Padding
Results
When the song is played forwards, the words are "Beyond the realms of death." When reversed, the band sings "I took my life."
Matlab Code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Kathleen Schremser %
% ECE 301 %
% Homework 1, due Friday, September 5, 2008 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear the screen
clear
clc
% Define the filename, assuming the file is called "jpforward", it is a
% .wav file, and it is in the PWD
file = 'jpforward.wav';
% Convert music (?) to Matlab data:
% data = digital signal, Fs = Frequency, nbits = number of bits per sample
[data, Fs, nbits] = wavread(file);
% Play the file
%wavplay(data, Fs)
% Find the length of the data, and save it as two different variables (to
% be used while looping)
L = length(data);
Ll = L;
% Create two arrays that will be able to hold the data once reversed, one
% for the regular reversal and one for the padded reversal
Reverse = ones(size(data));
Reverse2 = ones(size(data*2)+1);
% Reverse the data and play the result
for i = 1:L
Reverse(i) = data(Ll); Ll = Ll - 1;
end
%wavplay(Reverse, Fs)
% Now pad the data with 0s and play the result i=1; for j = 1:L
Reverse2(i) = Reverse(j); Reverse2(i+1) = 0; i = i + 2;
end
%wavplay(Reverse2, Fs)
% Create the file with the reversed sound
wavwrite(Reverse, Fs, 'jpreverse1')
wavwrite(Reverse2, Fs, 'jpreverse2')