Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

School of Electrical Engineering, Electronics Engineering,

and Computer Engineering


Laboratory Experiment Report Rubric

NAME OF STUDENT: DATE SUBMITTED:

Viado, Emmanuel Russell P. 6/25/2020


EXPERIMENT NUMBER AND TITLE EVALUATOR:

E03 ENGR. LEONARDO D. VALIENTE JR

Poor Fair Good Very Good Excellent


Criteria (1) (2) (3) (4) (5) Score

A. Completeness and The laboratory report is The laboratory report is The laboratory report is The laboratory report is The laboratory report is
organization of the untidy, did not follow untidy, followed the neat, followed the given neat, followed the given very neat, well
Experiment the given format, some given format, some parts format, some parts are format, no missing parts, presented, followed the
parts are missing, most are missing, most missing, mostly and only a few questions given format, organized,
Laboratory
questions are not questions are not questions are not are not answered. and the required content
Report answered. answered. answered. is complete.

The result, gathered The result is correct, The result and gathered The result and gathered The result, gathered
data, and answers to however, gathered data were correct, data were all correct, and data, and answers to
questions were all data, and answers to however, answers to most of the answers to questions are all correct.
incorrect. If data sheets questions were all questions were all questions are all correct. If data sheets are
B. Correctness of the are required in the incorrect. If data sheets incorrect. If data sheets If data sheets are required in the
gathered data and experiment, they are are required in the are required in the required in the experiment, data sheets
answers to not used. experiment, data experiment, data sheets experiment, data sheets are fully consulted and
questions. sheets are used but are consulted but some are consulted but with correct data are used in
wrong data are used in of the data used are few wrong data used in the tabulation or
the computation or wrong. the computation or computation.
tabulated. tabulation.

The interpretation of The interpretation of The interpretation of The interpretation of The interpretation of
data and discussion were data and discussion were data and discussion were data and discussion were data and discussion were
C. Interpretation of not based on the result based on the result and based on the result and based on the result and based on the result and
data and discussion and data gathered during data gathered during the data gathered during the data gathered during the data gathered during the
the experiment. experiment, but does not experiment, and experiment, and mostly experiment and are
present clarity. somehow presents presents clarity. presented very clearly.
clarity.

The conclusion was not The conclusion was The conclusion was The conclusion was The conclusion was
based on the objectives based on the objectives based on the objectives based on the objectives based on the objectives
D. Conclusion and all ideas are not but not all of the ideas and few of the ideas are and most of the ideas are and all of the ideas are
coherent or clear. are coherent nor clear. coherent but not too coherent and clear. coherent and presented
clear. very clearly.

The words used were not The words used were The words used were The words used were The words used were
appropriate, had poor somehow appropriate, appropriate, had good appropriate, had very appropriate, had
grammar, had bad had good grammar, had grammar, had good good grammar, had very excellent grammar, had
E. Use of Language sentence construction good sentence sentence construction good sentence excellent sentence
and ideas were not construction and not all and few of the ideas construction and almost construction and all of
clearly expressed. ideas were clearly were clearly expressed. all of the ideas were the ideas were clearly
expressed. clearly expressed. expressed.

The laboratory report The laboratory report The laboratory report The laboratory report The laboratory report
F. Promptness was submitted two or was submitted one was submitted three to was submitted one to was submitted on time.
more weeks late. week late. six days late two days late.

AVERAGE: (A+B+C+D+E+F)/6
Digital Signal Processing
Experiment 3

Viado, Emmanuel Russell P.

ECE107L-E02

Prof. Leonardo Valiente Jr.


Name: Viado, Emmanuel Russell ECE107L/E02
June 25, 2020

Exercises
For these exercises, use the command window to enter your code, and save your answers to files under
your account on the central server. Plot all graphs required in the exercises.

1. Given the signal x(n).


x(n) = {-2 4 -1 -3 5 8 2 -5}

Display the discrete waveform in the given expression below.


a. x(n)
Syntax: Answer:
>> x = [-2 4 -1 -3 5 8 2 -5];
>> t = 0 : length(x) - 1;
>> stem(t-3,x,'m<')

b. x(-n)
Syntax: Answer:
>> stem(-(t-3),x,'m<')
c. x(-n+3)
Syntax: Answer:
>> stem(-(t-3)-3,x,'m<')

d. 3x(n+4)
Syntax: Answer:
>> stem((t-3)-4,3*x,'m<')

e. 3x(n+4)
Syntax: Answer:
>> stem((t-3)+4,-2*x,'m<')
f. x(3n+2)
Syntax: Answer:
>> stem(((t-3)-2)/3,x,'m<')

g. 4x(3n-2)
Syntax: Answer:
>> stem(((t-3)+2)/3,4*x,'m<')

2. Plot the signals x(n) and h(n). Determine the value for y(n) which is equivalent to convolve signals
x(n) and h(n) and display resulting waveform.
X(n) = [-2 0 -1 -3 1 2 -2 -3] h(n) = [1 2 -1 1 -2]
For x(n)
Syntax: Answer:
>> x = [-2 0 -1 -3 1 2 -2 -3];
>> t = 0 : length(x) - 1;
>> stem(t-3,x,'m<')

For h(n)
Syntax: Answer:
>> h = [1 2 -1 1 -2];
>> n = -4:0;
>> stem(n,h,'m<')

For y(n)
Syntax: Answer:
>> y = conv(x,h);
>> n = -8:3;
>> stem(n,y,'m<')

3. Solve the roots of the following eqautions


a. 3𝑥 2 + 3𝑥 + 2 = 0
Syntax: Answer:
>> z = [3 3 2]; ans =
>> roots(z)
-0.5000 + 0.6455i
-0.5000 - 0.6455i
b. 4𝑥 4 − 9𝑥 3 + 8𝑥 − 10 = 0 Answer:
syntax: ans =
>> z1 = [4 -9 0 8 -10];
>> roots(z1) 2.0649 + 0.0000i
-1.1204 + 0.0000i
0.6528 + 0.8090i
4. Find the polynomial expression given the 0.6528 - 0.8090i
following factors
a. (x+5)(x+3)(x+5)(x+3) Answer:
syntax: ans =
>> x1 = [-5 -3 -5 -3];
>> poly(x1) 1 16 94 240 225

b. (x-4)(x-3)(x-5)(x+2) Answer:
Syntax: ans =
>> x2 = [4 3 5 -2];
>> poly(x2) 1 -10 23 34 -120

5.
a. Expand the expression below using
partial fraction expansion
4𝑠 3 + 2𝑠 2 − 𝑠 + 3
ℎ(𝑠) =
(𝑠 − 3)(𝑠 + 2)(𝑠 − 1) Answer:
Synatax: h=
>> a = [4 2 -1 3];
>> s = [3 -2 1]; 12.6000
>> b = poly(s); -1.2667
>> [h,i,j] = residue(a,b) -1.3333

i=

3.0000
-2.0000
1.0000

j=

4
b. Now, convert the partial fraction expansion back to polynomial coefficients. What did you
obtain? Is this similar to your original signal?
Syntax: Answer:
>> [a1,b1]= residue(h,i,j) a1 =

4.0000 2.0000 -1.0000 3.0000

b1 =

1.0000 -2.0000 -5.0000 6.0000

6.
a. Using your microphone record a 5-second audio saying “(Yoursurname) Digital Signal Processing
(Date Today)” with sampling frequency of 11025Hz
Syntax:
>> VIADO = audiorecorder(11025,16,1);
>> recordblocking(VIADO,5);
>> play(VIADO)
>> save VIADO
>> y1 = getaudiodata(VIADO);
>> plot(y1,'m')
b. Plot the signal you recorded
c. Play your audio signal. Give comments:
Syntax:
play(ESPIRITU_SANTO);
Answer:
The amplitude of the waveform increases whenever I started speaking and it decreased when I
stopped talking, in other words, it increases as signal comes in.
d. Using fft command, plot the frequency contents of your signal
Syntax: Answer:
>> Fs3 = 11025;
>> Yfft = fft(y1,512);
>> w = (0:255)/256*(Fs3/2);
>> figure;plot(w,abs([Yfft(1:256)]),'m')

7.
a. Create a lowpass FIR filter with 6th order filter, cutoff frequency of 2000Hz and sampling
frequency of 11025Hz. Determine the filter coefficients. Plot the poles and zeros of the filter, its
impulse response, and its freq response.
Pole-Zero Plot
B = Columns 1 through 5 : -0.0027 0.0426 0.2535 0.4130 0.2535
Columns 6 through 7: 0.0426 -0.0027
A=1
Syntax: Answer:
>> zplane(B,A)
Impulse Response
Syntax: Answer:
>> impz(B,A)

Magnitude Response
Syntax: Answer:
>> freqz(B,A)

b. Filter your original signal using lowpass filter created earlier. Plot the frequency content of
filtered signal. Describe the waveform,
Syntax: Answer:
>>Fs4 = 11025;
>> y1 = getaudiodata(ESPIRITU_SANTO);
>> lowfilter = filter(B,A,y1);
>> LowF = fft(lowfilter,512);
>> w1 = (0:255)/256*(Fs4/2);
>> plot(w1,abs([LowF(1:256)]),'m')
c. Play audio signal and describe what you hear.
The signal became softer than the original.
8.
a. Generate a high pass 6th order FIR filter with a cutoff freq of 1000Hz. Plot the poles and zeros of
the filter, its impulse response and magnitude response. Provide filter coefficients.
B = -0.0083 -0.0444 -0.1309 0.8103 -0.1309 -0.0444 -0.0083
A=1
Syntax: Answer:
>> Fs5 = 11025;
>> [B,A] = fir1(6,[1000]/(Fs5/2),'high')
>> zplane(B,A)

Impulse Response
Syntax: Answer:
>> impz(B,A)

Magnitude Response
Syntax: Answer:
>> freqz(B,A)
b. Filter your original signal using higpass filter created earlier. Plot the frequency content of
filtered signal. Describe the waveform.
Syntax: Answer:
>> Fs6 = 11025;
>> [F,E] = fir1(6,[1000]/(Fs6/2),'high')
>> highpfilter = filter (F,E,y1);
>> HighP = fft(highpfilter,512);
>> w2 = (0:255)/256*(Fs6/2);
>> plot(w2,abs([HighP(1:256)]),'m')
>> highpassf = audioplayer(highpfilter,Fs6);
>> play(highpassf);

c. Play audio signal and describe what you hear.


The volume increased
9.
a. Generate bandpass FIR filter with 30th filter order, cutoff frequencies of 2500Hz and 3000Hz.
Plot the poles and zeros of the filter and the magnitude response.
Pole-Zero Plot
Syntax: Answer:
>> Fs7 = 11025;
>> [D,C] = fir1(30,[2500 3000]/(Fs7/2),'bandpass');
>> zplane(D,C)
Impulse Reponse
Syntax: Answer:
>> impz(D,C)

Magnitude Reponse
Syntax: Answer:
>> freqz(D,C)

b. Filter your original signal using bandpass filter created earlier. Plot the frequency content of
filtered signal. Describe the waveform
Syntax: Answer:
>> Fs8 = 11025;
>> bpassfilter = filter (D,C,y1);
>> BPass = fft(bpassfilter,512);
>> w3 = (0:255)/256*(Fs8/2);
>> plot(w3,abs([BPass(1:256)]),'m')
>> bandpassf = audioplayer(bpassfilter,Fs8);
>> play(bandpassf);
c. Play audio signal and describe what you hear.
The pitch increase but the volume decreased in this part.
10.
a. Generate a stop band FIR filter with 30th filter order, cutoff freqs of 1500Hz and 3000Hz, plot the
freq contents of the signal and play it, plot the poles and zeros of the filter, its impulse response
then its freq response.
Pole-Zero Plot
Syntax: Answer:
>> Fs9 = 11025;
>> [E,F] = fir1(30,[1500 3000]/(Fs9/2),'stop');
>> zplane(E,F)

Impulse Response
Syntax: Answer:
>> impz(E,F)
Magnitude Response:
Syntax: Answer:
>> freqz(E,F)

b. Filter your original signal using stop band filter created earlier, Plot the frequency content of
filtered signal. Describe the waveform.
Syntax: Answer:
>> Fs10 = 11025;
>> [E,F] = fir1(30,[1500 3000]/(Fs9/2),'stop');
>> stopbfilter = filter(E,F,y1);
>> StopBF = fft(stopbfilter,512);
>> w4 = (0:255)/256*(Fs10/2);
>> plot(w4,abs([StopBF(1:256)]),'m')
>> stopband = audioplayer(stopbfilter,Fs10);
>> play(stopband);

c. Play audio signal and describe what you hear?


It really decreased in volume at the middle
References

 Essays, UK. (November 2018). A non-recursive filter. Retrieved from


<https://www.ukessays.com/essays/education.php?vref=1>.
 Smith, Steven W. (January 2011). The Scientist and Engineer’s Guide to Digital Signal Processing.
Chapter 6: Convolution.
 Heath, Janet. (October 3, 2016). Digital filters vs. Analog Filters. Retrieved from
<https://www.analogictips.com/using-analog-filters-vs-digital-filters/>.

You might also like