Вы находитесь на странице: 1из 12

1.

Reach the king (200 points)

Level 1(75 points): The king may be located at any point on the chess board. The
knight has to reach the king in the most efficient way (least number of moves).
The knight begins from the top left corner which shall be the starting point.

Let (m,n) be the position of the king. Then the knight at (1,1) has to reach
his king in the least number of moves possible while the king remains in the same
position. Remember how the knight moves on the chess board! Let him rush to
his king’s aid as soon as he can.

The input will be the position of the king on the chess board (m,n). So (8,8)
can be the farthest distance possible between king and knight. The output should
be in column form containing the row and column values of the knight’s position
after each move. The position is represented as (row,column).

Format: knight=rtk1(m,n)

For example: knight = rtk1 (5, 3)

Output:

knight =

1 1
3 2
5 3

Remember that you have to make the least number of moves to reach the king. If
you take a longer route, it may be too late to save the king!

Bonus:

Level 2(+50 points):O.K. you solve the above problem this should also be a piece
of cake. Assume that the knight can start from any position on the board. We
choose the knight’s starting position as (a,b).So in this case the input should be in
this format(use rtk2 as file name for this question):

knight = rtk2(a,b,m,n)

Output should show the starting point (a,b ) and the ending point (m,n)

Level 3(+100 points): Lets take the problem to the next level. Now, assume that
the king can also move as it normally moves on the chessboard. So after the first
move from the knight, the king makes a move. Then the knight moves. This goes
on. They should meet in the least number of moves! If you can solve this question
using level 1 condition, you get half the points. Solve it using level 2 conditions
and you get all of them!! (Use rtk3 as file name for this question)

Sample output: [knight king] =rtk3(5,3)

Output:

knight =

1 1
2 3
4 2

king =

5 3
4 2
2. Simple separation (50points)
In this problem the input is a color image containing two types of boxes in
rectangular are circular shape. The dark ones are filled with coal while the white
boxes are empty. Just perform the simple task of reporting how many filled and
empty boxes are present. A sample image is given for your reference:

All input images used to test your code will be of size 200*200 and in jpg format.
Let X be the image stored in a matrix form.

Format: [filled empty]=ss(X)

Output(for the given test case):

filled =

empty =

Send us the code with file name ss.m


3. Play with ECHOES (100 points)

Ashish sends a message to Laxman who is standing on the opposite side of a big
lake. But Laxman faces a problem because of the echoes of sound due to the hills
which were present on the other two sides of the lake. The message received by
Laxman is recorded in the file “echo.wav”. Now your task is to make a Matlab
program (pwe.m) to extract the original message (which is free of echoes).

Format [msg samplerate]=pwe(‘echo.wav’);


msg -output message in matrix form.
samplerate – to play the message

Specifications:
1) There is 20% loss of sound amplitude due to reflection.
2) Neglect the phase change due to reflection.
3) The different path lengths are AB = 960 m, CO=200 m, DO = 360 m.
4) Take velocity of sound as 300 m/s.
5) Sampling rate:11025samples/s.

File to be used is ‘echo.wav’


4. Intelligent painting (150 points)
Write a Matlab program (*.m) that makes a drawing according to the directions
given in the file “command.wav”. The file “command.wav” contains some spoken
commands like, “UP”, “DOWN”, “RIGHT”, “LEFT” .Now your task is to play the
“command.wav” file first and whenever a command comes you should plot a line
segment of unit length according to that command.
Specifications:
1) Take x axis from (-10 to +10) units and y axis from (-10 to +10) units.
2) Each line segment (to be drawn in the figure) should be of unit length.
3) The drawing (i.e. the first line segment) should start from the origin and the
starting point of a new line segment should be the ending point of the previous
line.
3)”UP” – means draw a line segment in the +Y axis direction.
4) “DOWN” – means draw a line segment in the –Y axis direction.
5)”RIGHT” – means draw a line segment in the +X axis direction.
6)”LEFT” – means draw a line segment in the –X axis direction.

Format: out_image=ip(‘audio file’);


out_image – the final output image as a matrix

Note: wav files for each “right”, ”left”, ”up”,” down” are given in the same names.

Sample File:”command.wav”

Send us the code with file name ip.m


5. SPIES (50 points)
Two spies Rajiv and Benzun are on a very sensitive mission. Rajiv gets his hand on
some secret information but he is in trouble, and somehow he sends Benzun an
encoded wave file voice.wav and a handwritten note to help him to decode the
voice file to get the original message, and asked him to deliver it to the
headquarter. The message is something like this:

LOCK: YEKEHTTEGDNASIHTEVLOS

Now Benzun starts thinking how can I decode this message without a KEY? So he
tries to contact Rajiv and finally succeeded. But they have to converse in short
and in an unclear way so that enemy even if they intercept them gets nothing.
Benzun: you have sent me only LOCK, where is the KEY?
Rajiv: that’s enough…
And the line went dead after this
Still Benzun doesn’t get anything. Now as the senior of SPY Benzun your job is
 To decode the above message.
 To get the operation to be performed on voice.wav.
 To obtain the original message.

File to be used: “voice.wav”

Format: [secret samplerate]=spies(‘voice.wav’);

secret – the decoded message in matrix form

samplerate - to play the secret message

Submit your output as spies.m


6. Make a trapezium (75 points)

You are given 4 bars connected to each other in a single plane as shown in the
figure. The bar L4 is fixed, and cannot be rotated about any joint. However, L1, L2
and L3 can be rotated freely. Given the lengths L1, L2, L3 and L4 of the 4 bar
mechanism shown in the figure, you are required to calculate whether it is
possible to make the bar L2, parallel with respect to the bar L4.

INPUT: A vector of lengths [L1, L2, L3, L4]


OUTPUT: You need to first indicate whether the bar L2 can be made parallel, and
if yes, you need to indicate angles [a, b] such that L2 is parallel to L4

Format: [parallel a b]= trapez([L1,L2,L3,L4]);

Note: parallel = 1 if L2 can be made parallel to L4, else 0.

Sample input: [5, 6, 7, 15];


sample output: [1, 50.70, 33.55];

Send us the code with file name trapez.m


7. Develop a camera (200 points)
You are a member of Research & Development wing in CANON. Your company
is now introducing an automatic motion de-blurring feature in the upcoming
latest model. To impress your boss you thought that you could simulate the whole
de-blurring process.

Write a MATLAB program (*.m) which takes in a blurred image and gives out
the de-blurred image and blur length. Motion blurring will be only in the
horizontal direction and blur lengths will have a range from 100 pixels to 200
pixels.

Format: [outputImage blurlength] = deblur_cam(inputImage)

outputImage – the final output image as a matrix

blurlength – length of blur in pixels

Note:
1) image input is a color image.
2) Better results will be getting more points.

Sample input image: ‘blur. jpg’

Send us the code with file name deblur_cam.m


8. De-noise (150 points)
Suppose that you’re Mr. X, working as a secret agent with Indian Army at Indo-
Pak border. At the border, you notice that the enemy is sending in
electromagnetic pulses between 50-150MHz. It is important for you to know the
enemy’s messages. So you take an antenna, aim it at the source and digitize the
receiver’s output at 1Mega samples/second. Somehow, you found out the noise
power to be concentrated at frequency above 280 MHz. Having this information,
you pass the receiver output through a low pass FIR filter. Number of weights
used in the filter is N=127.

Write a matlab program to get the original signal. Find the duration between
peaks of two pulses in the de-noised signal.

Format: [outputsignal timegap]=de_noise(varibalename)

Note:
1)File to be used is ‘signal.mat’.
2) Use ‘load‘function to get the noise signal named ‘inputSignal’.
3) The output variable ‘duration’ should be given in milliseconds.

Send us the code with file name de_noise.m


9. Kindergarten (100 points)
There are these interesting little games, where small kids have to recognize
triangles and circles and then count them. As part of the young children’s
program you register for helping schools develop a higher level of teaching after
having seen the state of so many uneducated children in country X. You reach a
primary school where you see small children playing with blocks, and trying to
build simple tall like structures, and some of the really young ones having fun with
squares and circles. Seeing this, you suddenly remember your recently bought
digital camera, and you click a lot of photos

One fine day, while browsing through these photos, you see a challenge.
Considering any image with triangles and circles, you try to count the number of
squares and circles. The figures are all solid. Your objective is to now write a code
that will take in an image matrix, and count the number of squares and circles you
find in them.

Format: [ncircle ntriangle]=kids(imageMatrix)


ncircle : no. of circles.
ntrianlge : no. of triangles.

Sample input image


Sample output:

ncircle =
2

ntrianlge =
3

Note:
1)Input is a color image with objects in bright colors and background in black.
2)triangles are having all angles more than 10degrees.
3) Objects don’t overlap each other.

Send us the code with file name kids.m


10. Simulink (175 points)
a)Prodigy(100 points)

Arvind, nicknamed ‘Jar’, is a prodigy. He wrote his first successful C program when
he was 5. He built a line follower robot when he was ten. When he was 11,he
entered a prominent institute for doing his undergraduate studies in electronics
and communication engineering. One of his interview questions was to design a
model that uses only a single DC power supply of 12 V to generate two sinusoidal
signals of frequency ‘x’ and ‘2x’ .Then ,treat the signal with frequency ‘2x’as a
carrier and signal with frequency ‘x’ as the message and perform amplitude
modulation with modulation index 0.8.

Jar is addicted to matlab and carries his laptop with him everywhere. For the
above question Jar used ‘simulink’ to create a model that performed the required
operations and produced a plot of the amplitude modulated waveform.

Jar, who is 21 years old now likes to see how many fans of simulink are out there
who can do what he did back then. Best of luck!

b)Prodigy’s Best Friend(75points)

Jar’s best friend Santosh Raj is crazy about digital electronics. He likes to see if
anyone can use simulink to design a sequence detector that detects 101101 or
10010

For parts ‘a’ and ‘b’ upload required simulink models with file names
simulink1.mdl and simulink2.mdl respectively.

Вам также может понравиться