Professional Documents
Culture Documents
Dsaa Assignment 3: Nancy 201303010
Dsaa Assignment 3: Nancy 201303010
Assignment 3
REPORT
Nancy
201303010
Question 1.
0.1
0
-0.1
7
4
x 10
0.1
0
-0.1
10
12
4
x 10
0.1
0
-0.1
10
12
4
x 10
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Cos Of Freq 1000Hz
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
fft
10000
9000
8000
7000
6000
5000
4000
3000
2000
1000
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Cophasic Addition with Cos of 1000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Cophasic Addition with Cos of 1000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Cophasic Addition with Cos of 1000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Antiphasic Addition with Cos of 1000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Antiphasic Addition with Cos of 2000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Antiphasic Addition with Cos of 10000Hz
1.5
Values
0.5
-0.5
-1
-1.5
0.2
0.4
0.6
0.8
1
time
1.2
1.4
1.6
1.8
2
4
x 10
12000
10000
8000
6000
4000
2000
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2
4
x 10
Question 3.
In this question we are trying to predict the temperatures of the next 10 days and we are given the
data of Jan 1st - May 3rd, 2011 by using Linear Prediction (LPC). For this we have
used lpc() to get coefficients and then filter() to get estimated values in an
array.
The predicted values are :
44.0305, 45.0673, 45.2529, 45.9068, 46.2702, 47.0061, 47.2853, 47.9678, 48.1061, 48.8607
Question 4.
In this question we have been asked to compress the given greyscale images.
Steps:
1 I have taken an image and read it as Greyscale image and then I have performed dct ()
function row by row on the 2-D matrix that come out on reading the image as Greyscale.
After that I have performed ci2 ci4 etc. and idct (), that is the inverse dct function, to
reconstruct the compressed images.
The above things I have done on firstly the 1D compression and the output are:
IMAGE 1:
Original Image
Compression Factor 2
50
50
100
100
150
150
50
50
Compression Factor 4
Compression Factor 8
50
50
100
100
150
150
50
50
Original Image
Compression Factor 2 * 2
50
50
100
100
150
150
50
50
Compression Factor 4 * 4
Compression Factor 8 * 8
50
50
100
100
150
150
50
50
IMAGE 2 :
Original Image
Compression Factor 2
200
200
400
400
600
100
200
300
400
500
600
Compression Factor 4
200
400
400
100
200
300
400
200
300
400
500
Compression Factor 8
200
600
100
500
600
100
200
300
400
500
Original Image
Compression Factor 2 * 2
200
200
400
400
600
100
200
300
400
500
600
Compression Factor 4 * 4
200
400
400
100
200
300
400
200
300
400
500
600
100
200
300
400
IMAGE 3 :
Original Image
Compression Factor 2
100
100
200
200
300
300
400
400
100
200
300
400
100
Compression Factor 4
100
200
200
300
300
400
400
200
300
400
200
300
400
Compression Factor 8
100
100
500
Compression Factor 8 * 8
200
600
100
100
200
300
400
500
Original Image
Compression Factor 2 * 2
100
100
200
200
300
300
400
400
100
200
300
400
100
Compression Factor 4 * 4
100
200
200
300
300
400
400
200
300
400
300
400
Compression Factor 8 * 8
100
100
200
100
200
300
400
The first one is for the 1D compression with the factors given and the second one is for 2D
compression.
ERMS Matrix values goes on increasing as compression factor increases and image becomes more
blurred.