Write a function called blur that blurs the input image

Assignment Help Programming Languages
Reference no: EM132345169

1st program -Character encoding using ASCII values rotation w.r.t to certain range

2nd program - Image blur problem

3rd program - Echo generation in audio file

In every text file, Mentioned errors for certain inputs-Please make the program to work for such inputs.

If required, please change the program,

Requirement is given as questions in the file.

Echo Generator
Write a function called echo_gen that adds an echo effect to an audio recording. The function is to be called like this:

output = echo_gen(input, fs, delay, amp);

where input is a column vector with values between -1 and 1 representing a time series of digitized sound data. The input argument fs is the sampling rate. The sampling rate specifies how many samples we have in the data each second. For example, an audio CD uses 44,100 samples per second. The input argument delay represent the delay of the echo in seconds. That is, the echo should start after delay seconds have passed from the start of the audio signal. Finally, amp specifies the amplification of the echo which normally should be a value less than 1, since the echo is typically not as loud as the original signal.

The output of the function is a column vector containing the original sound with the echo superimposed. The output vector will be longer than the input vector if the delay is not zero (round to the nearest number of points needed to get the delay, as opposed to floor or ceil). A sound recording has values between -1 and 1, so if the echo causes some values to be outside of this range, you will need to normalize the entire vector, so that all values adhere to this requirement.

MATLAB has several sample audio files included that you can try: splat, gong, and handel are a few examples. Try the following:

load gong % loads two variables, y and Fs
sound(y, Fs) % Outputs sound

To hear the sound you will need to use desktop MATLAB or MATLAB Online.
(Note that we are assuming mono audiofiles. You can load your own audio files using the audioread function in MATLAB. If the audio data has two columns, it is a stereo file, so use only one column of the data when testing your file.)

errors

%Variable output has an incorrect value.
%Tested with the vector [-0.5; 0; 0.5; 0] and the following parameters: fs = 1, delay: 0.0 seconds, amp = 0.5
% Assessment result: incorrectUsing splat sound file
%Variable output has an incorrect value.
%Tested with the splat file and the following parameters: fs = 8192, delay: 0.2 seconds, amp = 0.2

Image blur
Write a function called blur that blurs the input image. The function is to be called like this:
output = blur(img,w);

where img, the input image is a two-dimensional matrix of grayscale pixel values between 0 and 255. Blurring is to be carried out by averaging the pixel values in the vicinity of every pixel. Specifically, the output pixel value is the mean of the pixels in a square submatrix of size 2w+1 where the given pixel sits in the center. For example, if w is 1, then we use a 3x3 matrix, that is, we average all the neighboring pixels of the given pixel and itself. Only use valid pixels when portions of the blurring matrix fall outside the image. For example, the blurred value corresponding to w = 1 at index (1,1) would be the mean of of elements (1,1), (1, 2), (2,1) and (2, 2). Both input img and output output are of type uint8.

You can download the test image here (refer vandy.png downloaded file) to use in MATLAB.

Errors

Simple test:(error)
Variable output has an incorrect value.
Tested with a 5x5 uint8 matrix with all 255-s in the first and last rows and columns and zeros everywhere else and w = 1

Assessment result: (error)
incorrect Using image file
Variable output has an incorrect value.
Tested with the vandy.png file and w = 1

Simple Encryption

Simple Encryption
Caesar's cypher is the simplest encryption algorithm. It adds a fixed value to the ASCII (unicode) value of each character of a text. In other words, it shifts the characters. Decrypting a text is simply shifting it back by the same amount, that is, it substract the same value from the characters. Write a function called caesar that accepts two arguments: the first is the character vector to be encrypted, while the second is the shift amount. The function returns the output argument coded, the encrypted text. The function needs to work with all the visible ASCII characters from space to ~. The ASCII codes of these are 32 through 126. If the shifted code goes outside of this range, it should wrap around. For example, if we shift ~ by 1, the result should be space. If we shift space by -1, the result should be ~. Here are a few things you may want to try with MATLAB before starting on this assignment:

Errors for the following

caesar(' !"#tiny_mce_markeramp;()*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~',243)

caesar('MATLAB is fun!',-122)

caesar('x = mean(1:90) + sum(rand(1,23)');',81)

caesar('MOOC-s are very useful',-104)

Attachment:- Program Assignment.rar

Reference no: EM132345169

Questions Cloud

Imperative precision and value to improve : Mission - "University Hospital will provide healthcare with imperative precision and value to improve the lives of our patients."
Describe the statement is fact or fiction : In this discussion you will conduct internet research in an attempt to determine whether or not the following statement is fact or fiction.
Describe the overall financial course : In five hundred words, describe the overall financial course (credit cards; checking accounts; credit scores and reports; savings) you have completed
Discuss about the accounting for a business combination : What is the primary difference between: accounting for a business combination when the subsidiary is dissolved; and accounting for a business combination.
Write a function called blur that blurs the input image : Write a function called echo_gen that adds an echo effect to an audio recording and Write a function called blur that blurs the input image
Identify five gaps in the performance data : Analyse the data in the case study. Identify five gaps in the performance data given, which could be filled by introducing more performance measurements (KPIs).
Determine the exact value of pressure gradient : ENG513 Numerical and Computational Methods in Petroleum Engineering Assignment, University of Portsmouth, UK. Determine the exact value of pressure gradient
Samples of qualitative research interviews questions : Samples of qualitative research interviews questions with relevance to Electronic Health Records and their impact on physicians efficiency and positive patient
Do you agree with the opinion below : Do you agree with the opinion below? Why, or why not. What is your thought?

Reviews

len2345169

7/24/2019 9:56:29 PM

1st program -Character encoding using ASCII values rotation w.r.t to certain range 2nd program - Image blur problem 3rd program - Echo generation in audio file In every text file, I have mentioned errors for certain inputs-Please make the program to work for such inputs. If required, please change the program, Requirement is given as questions in the file. solution should be shared as word doc

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd