0% found this document useful (0 votes)
27 views14 pages

Dsaa Assignment 3: Jyoti Misra 201303007

The document reports on several signal processing and image compression assignments. It includes plots of synthesized sounds generated through k-means clustering and IFFT. It also plots sinusoidal signals with different frequencies and their addition both in-phase and out-of-phase. Further, it describes predicting temperature data using linear prediction coding and compressing grayscale images using DCT with different compression factors.

Uploaded by

Kartik Dutta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views14 pages

Dsaa Assignment 3: Jyoti Misra 201303007

The document reports on several signal processing and image compression assignments. It includes plots of synthesized sounds generated through k-means clustering and IFFT. It also plots sinusoidal signals with different frequencies and their addition both in-phase and out-of-phase. Further, it describes predicting temperature data using linear prediction coding and compressing grayscale images using DCT with different compression factors.

Uploaded by

Kartik Dutta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

DSAA

Assignment 3
REPORT
Jyoti Misra
201303007
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

The graph shows :


1. Plot of training sound
2. Plot of synthesized sound from training sound without k means after idft
3. Plot of synthesized sound after k means and idft
In the training stage:
We first read the sound and make it mono if stereo
The frame size is 20msec as mentioned
We then compute the dft for each 20msec sample

In the testing Stage :


We compute the dfts for 20msec samples for the test file. Initially ctrs are the k mean vectors which
we calculated .Now here for each sample of 20 msec which we have as a complex vector of
length 512, we will find which of the means in ctrs is closest to this
vector and thus make a new set of dft using those means.
Now we will apply idft on the test dft and the dft made using the k means
on the test dft.
Question 2.
All the signals have been plotted as shown below and run the program for sounds.

Sin Of Freq 200Hz

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 of sin 200hz

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

FFT of Cophasic Addition with Cos of 1000Hz

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

FFT of Cophasic Addition with Cos of 2000Hz

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

FFT of Cophasic Addition with Cos of 10000Hz

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

FFT of Antiphasic Addition with Cos of 1000Hz

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

FFT of Antiphasic Addition with Cos of 10000Hz

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

FFT of Antiphasic Addition with Cos of 10000Hz

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

200

200

400

400

600

600
200

400

600

800

200

Compression Factor 4

200

400

400

600

600
400

600

800

600

800

Compression Factor 8

200

200

400

200

400

600

800

Original Image

Compression Factor 2 * 2

200

200

400

400

600

600
200

400

600

800

200

Compression Factor 4 * 4

200

400

400

600

600
400

600

600

800

Compression Factor 8 * 8

200

200

400

800

200

400

600

800

IMAGE 2 :
Original Image

Compression Factor 2

100

100

200

200

300

300

400

400
200

400

600

200

Compression Factor 4
100

200

200

300

300

400

400
400

600

600

Compression Factor 8

100

200

400

200

400

600

Original Image

Compression Factor 2 * 2

100

100

200

200

300

300

400

400
200

400

600

200

Compression Factor 4 * 4
100

200

200

300

300

400

400
400

600

Compression Factor 8 * 8

100

200

400

600

200

400

600

IMAGE 3 :
Original Image

Compression Factor 2

100

100

200

200

300

300

400

400
200

400

600

200

Compression Factor 4
100

200

200

300

300

400

400
400

600

Compression Factor 8

100

200

400

600

200

400

600

Original Image

Compression Factor 2 * 2

100

100

200

200

300

300

400

400
200

400

600

200

Compression Factor 4 * 4
100

200

200

300

300

400

400
400

600

600

Compression Factor 8 * 8

100

200

400

200

400

600

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.

You might also like