Revision as of 11:04, 4 September 2008 by Zcurosh (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Playing a Judas Priest Song - The Code

%Zachary Curosh
%ECE 301 - Homework 1.2
%9/5/2008
clear;
clc;

%First use the wavread command to get the data, sample rate, and bits per
%sample of the judas priest file.

[data,sample_rate,bits]=wavread('jpforward.wav');

%Next, play the original file normally

fprintf "Playing the original file."
wavplay(data,sample_rate)

%Then we have to reverse the song using the command fliplr

data_rev=flipud(data);

%Next we have to play the reversed song

wavplay(data_rev,sample_rate)

%Then, to play the song slower, simply multiply the sample rate by a
%fraction. Here, I will use 1/2 the rate.

wavplay(data_rev,sample_rate*0.5)

%Lastly, I will write the backwards song using the wavwrite command

wavwrite(data_rev,44100,'Backwards_at_RegularSpeed');
wavwrite(data_rev,22050,'Backwards_at_0.5Speed');

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang