(→Files) |
(→Matlab Code) |
||
Line 4: | Line 4: | ||
== Matlab Code == | == Matlab Code == | ||
+ | <pre> | ||
+ | %Joseph Mazzei ECE 301 HW1 Problem 2 | ||
+ | %Clear Console and all Variables | ||
+ | clc | ||
+ | clear all | ||
+ | |||
+ | %Get a vector of the wav data and the sampling frequency | ||
+ | [foward,fs] = wavread('Jpforward.wav'); | ||
+ | %Play the wav forwards | ||
+ | sound(foward,fs); | ||
+ | %Reverse the wav data vector | ||
+ | backward = flipud(foward); | ||
+ | %Write a wav of the backwards data at the original sampling frquency | ||
+ | wavwrite(backward,fs,'jpbackwards.wav'); | ||
+ | %Play the wav backwards at original sampling frequency. | ||
+ | sound(backward,fs); | ||
+ | %Write a wav of the backwards data at 70% the original sampling frquency | ||
+ | wavwrite(backward,fs*.7,'jpbackwards70psampling.wav'); | ||
+ | %Play the backwards file at 70% original sampling frequency. | ||
+ | sound(backward,fs*.70); | ||
+ | </pre> |
Revision as of 15:51, 3 September 2008
Files
Media: jpbackwards_ECE301Fall2008mboutin.wav Media: jpbackwards70sampling_ECE301Fall2008mboutin.wav
Matlab Code
%Joseph Mazzei ECE 301 HW1 Problem 2 %Clear Console and all Variables clc clear all %Get a vector of the wav data and the sampling frequency [foward,fs] = wavread('Jpforward.wav'); %Play the wav forwards sound(foward,fs); %Reverse the wav data vector backward = flipud(foward); %Write a wav of the backwards data at the original sampling frquency wavwrite(backward,fs,'jpbackwards.wav'); %Play the wav backwards at original sampling frequency. sound(backward,fs); %Write a wav of the backwards data at 70% the original sampling frquency wavwrite(backward,fs*.7,'jpbackwards70psampling.wav'); %Play the backwards file at 70% original sampling frequency. sound(backward,fs*.70);