Line 1: Line 1:
[[Category:ECE264]] [[Category:Programming]] [[Category:C]] [[Category:lecture notes]]
+
[[Category:ECE301]] [[Category:Programming]] [[Category:Matlab]] [[Category:lecture notes]]
  
=Lecture 1, [[ECE264]], Spring 2012, Prof. Lu=
+
=Lecture 1, [[ECE301]], Summer 2009, Landis Huffman=
 
----
 
----
 
'''Here is a Matlab script reflecting Lecture 1.  The script plays various audio signals. Copy and paste the script into an m-file and play:'''
 
'''Here is a Matlab script reflecting Lecture 1.  The script plays various audio signals. Copy and paste the script into an m-file and play:'''
Line 37: Line 37:
 
sound(x,1/delta);
 
sound(x,1/delta);
 
----
 
----
[[2012_Spring_ECE_264_Lu|Back to ECE264, Spring 2012, Prof. Lu]]
+
[[ECE301_%28HuffmalmSummer2009%29|Back to ECE301, Summer 2011, Landis Huffman]]

Latest revision as of 05:30, 11 July 2012


Lecture 1, ECE301, Summer 2009, Landis Huffman


Here is a Matlab script reflecting Lecture 1. The script plays various audio signals. Copy and paste the script into an m-file and play:


load handel; %Loads 2 variables, y and Fs. y is a signal containing information: a vector of numbers representing an audio clip. Fs is the sampling frequency.

sound(y,Fs); %play the audio file at the appropriate sampling frequency.

input('Press enter to hear the same audio with 1/4 the samples')

downsample = 4; %factor to decrease sampling rate by sound(y(1:downsample:end)*downsample,Fs/downsample); %Plays the same signal with only 1/4 of the original "information." Note the degradation in quality

input('Press enter to hear the same audio with 1/100 of the original samples')

downsample = 100; %factor to decrease sampling rate by sound(y(1:downsample:end)*downsample,Fs/downsample); %Plays the same signal with only 1/100 of the original "information." Original audio is nearly unrecognizable.

input('Press enter to hear a constant tone note A')

delta = 0.00005; %Sampling period t = 1:delta:3; %a vector representing 3 seconds of time x = sin(2*pi*440*t); %a vector representing the sinusoid tone A

sound(x,1/delta);

input('Press enter to hear a tone note A an octave higher') x = sin(2*pi*880*t); %a vector representing the sinusoid tone A an octave higher

sound(x,1/delta);


Back to ECE301, Summer 2011, Landis Huffman

Alumni Liaison

BSEE 2004, current Ph.D. student researching signal and image processing.

Landis Huffman