task1 - %Script to generate the solutions for HW11 of ECE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%Purdue University, Fall 2010 %Daniel Aguiar clear close all clc %Set constants as specified duration=8; f_sample=44100; t = (((0-4)*f_sample+0.5):((duration-4)*f_sample-0.5))/f_sample; %Load x1 [x1, f_sample, N] = wavread('x1.wav'); x1 = x1'; %Create the sin and sinc vectors f = 440; s = sin(2*pi*f*t); sc = sin(pi*t)./(pi*t); %Objective 1 ************************************ figure; subplot(2,1,1) plot(t,s) axis([-0.01,0.01,-2,2]); grid on; subplot(2,1,2) plot(t,sc); axis([-4,4,-0.5,1.5]); grid on; saveas(gcf, 'hw11_task1_objective1.eps'); close gcf; %Objective 2 ************************************ s1 = sin(2*pi*440*t); s2 = sin(2*pi*350*t); y = s1+s2; %soundsc(y,f_sample); figure; plot(t,y); axis([-2.28, -2.255, -2.2 2.2]); saveas(gcf, 'hw11_task1_objective2.eps'); close gcf; %Objective 3 ************************************ h = sin(2*pi*1000*t)./(pi*t); figure; plot(t,h) axis([-0.01,0.01,-3000,3000]); grid on; saveas(gcf, 'hw11_task1_objective3.eps');
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

task1 - %Script to generate the solutions for HW11 of ECE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online